Commits

camlspotter committed 579b23f

cleanup

Comments (0)

Files changed (5)

+.*\.cm[a-z]+$
+.*~$
+\.(sp[io]t|annot|o|cm[a-z]+|orig|omc|lock|so|a|exe|byt)$
+\.omakedb$
+^auto\.(idl|ml|mli)
+^auto_stubs\.c
+autoapi\.ml
+
+( ゚∀゚)o彡°O'PyCaml
+
+  If you do not see a For-all sign at the first line, install unicode capable fonts.
+
+What currently you can do:
+
+  You can call some of Python/C API functions from OCaml.
+
+How to install:
+
+  Read INSTALL.txt
+
+How to use:
+
+  test.ml is for an example.
+
+  - api.ml provides the main Python/OCaml interface. 
+    Use "open Opycaml.Api" in your OCaml programs.
+
+  - Do not forget calling Base.initialize for initialization.
+
+  - autoapi.ml is auto-created by CamlIDL. It provides almost of 
+    all the available API functions in OPyCaml. Their comments are
+    from Python/C API reference, which are useful to understand them.
+
+  - api.ml extends autoapi.ml, providing things not easily done by
+    CamlIDL's code generator.
+
+  - A C function Py<Hoo>_<Bar> is found as a function <bar> 
+    (note thta the first letter is lowercased) in ML submodule <Hoo>. 
+    For example:
+
+      PyString_Check => String.check
+      PyObject_Repr =>  Object.repr
+
+    There is one exception: If a C function has all-capital-or-underscore
+    postfix name, such as PyTuple_GET_ITEM, its ML function name is not
+    first letter lowercased but is prefixed by '_':
+
+      PyTuple_GET_ITEM => Tuple._GET_ITEM
+
+ 
   include Base
 
   external none : unit -> t = "opycaml_none"
+    (** Get Py_None object. *)
+
   external phys_eq : t -> t -> bool = "py_physical_equal"
 
   external refcnt : t -> int = "opycaml_refcnt"

finance_demo.py

-#!/usr/bin/env python
-from pylab import *
-from matplotlib.dates import  DateFormatter, WeekdayLocator, HourLocator, \
-     DayLocator, MONDAY, timezone
-from matplotlib.finance import quotes_historical_yahoo, candlestick,\
-     plot_day_summary, candlestick2
-
-import datetime
-
-date1 = datetime.date( 2010, 2, 1)
-date2 = datetime.date( 2010, 4, 12 )
-
-
-mondays = WeekdayLocator(MONDAY)        # major ticks on the mondays
-alldays    = DayLocator()              # minor ticks on the days
-weekFormatter = DateFormatter('%b %d')  # Eg, Jan 12
-dayFormatter = DateFormatter('%d')      # Eg, 12
-
-quotes = quotes_historical_yahoo(
-    'INTC', date1, date2)
-if not quotes:
-    raise SystemExit
-
-fig = figure()
-fig.subplots_adjust(bottom=0.2)
-ax = fig.add_subplot(111)
-ax.xaxis.set_major_locator(mondays)
-ax.xaxis.set_minor_locator(alldays)
-ax.xaxis.set_major_formatter(weekFormatter)
-#ax.xaxis.set_minor_formatter(dayFormatter)
-
-#plot_day_summary(ax, quotes, ticksize=3)
-candlestick(ax, quotes, width=0.6)
-
-ax.xaxis_date()
-ax.autoscale_view()
-setp( gca().get_xticklabels(), rotation=45, horizontalalignment='right')
-
-show()
-
-open Opycaml
-open Api
+open Opycaml.Api
 
 let _ =
   prerr_endline "start";