diff options
| author | Guillaume Horel <guillaume.horel@serenitascapital.com> | 2016-06-28 15:30:16 -0400 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@serenitascapital.com> | 2016-06-28 15:30:16 -0400 |
| commit | 60e49a606ae270fb4d455da1b565e0ea656ffb3c (patch) | |
| tree | ada0b2e8bfa6b5bb4dc8180f7d83ca57572378e5 /yearfrac.pyx | |
| download | pyisda-60e49a606ae270fb4d455da1b565e0ea656ffb3c.tar.gz | |
initial import
Diffstat (limited to 'yearfrac.pyx')
| -rw-r--r-- | yearfrac.pyx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/yearfrac.pyx b/yearfrac.pyx new file mode 100644 index 0000000..48b8995 --- /dev/null +++ b/yearfrac.pyx @@ -0,0 +1,11 @@ +from pyisda.yearfrac cimport JpmcdsStringToDayCountConv + +cdef long dcc(str day_count): + cdef long r + dc_bytes = day_count.encode('utf-8') + cdef char* dc = dc_bytes + cdef err = JpmcdsStringToDayCountConv(<char*> dc, &r) + if err == 0: + return r + else: + raise ValueError('{0} is not a valid day count'.format(day_count)) |
