scrape.nasdaq: Strip whitespace from scraped values
[insider.git] / README
1 Insider is a transaction-tracking application written in Python_ using
2 the Django_ framework.
3
4 Install
5 =======
6
7 Download
8 --------
9
10 Insider is published as a Git_ repository.  See `insider's web
11 interface`__ for more information.
12
13 __ insider_
14
15 Dependencies
16 ------------
17
18 Outside of Django_ and the Python_ standard libraries, the only
19 required dependency is `django-tables2`_ (docs__).  For some of the
20 scraping libraries (`insider/scrape/*`), you'll also need
21 BeautifulSoup_.
22
23 __ dt2-docs_
24
25 Quick-start
26 ===========
27
28 If you don't have a Django project and you just want to run insider as
29 a stand-alone service, you can use the example project written up in
30 `example`.  Set up the project (once)::
31
32   $ python example/manage.py syncdb
33
34 See the `Django documentation`_ for more details.
35
36 Run
37 ===
38
39 Run the app on your local host (as many times as you like)::
40
41   $ python example/manage.py runserver
42
43 You may need to add the current directory to `PYTHONPATH` so `python`
44 can find the `insider` package.  If you're running `bash`, that will
45 look like
46
47   $ PYTHONPATH=".:$PYTHONPATH" python example/manage.py runserver
48
49 Scraping
50 ========
51
52 Entering transaction data by hand can be tedious and error prone.  To
53 automate the task, you should write scrapers to look up and enter
54 transaction data automatically.  To get you started, I've written
55 `insider/scrape/nasdaq.py`, which scrapes `NASDAQ's interface`__ to
56 `EDGAR`_\'s data.  Use the scraper with something like::
57
58   $ export PYTHONPATH='.'
59   $ export DJANGO_SETTINGS_MODULE='example.settings'
60   $ python insider/scrape/nasdaq.py NYSE:RHT NASDAQ:GOOG
61
62 __ NASDAQ_
63
64 If the scraper doesn't extract company names (`nasdaq.py` does not),
65 it's probably a good idea to add the relevant `Company` and `Ticker`
66 to the database before running the scraper.  Otherwise you may get
67 tickers from several exchanges all pointing to the company `UNKNOWN`.
68
69 Hacking
70 =======
71
72 This project was largely build following the `Django tutorial`_.
73 That's a good place to start if you're new to Django.
74
75 .. _Python: http://www.python.org/
76 .. _Django: https://www.djangoproject.com/
77 .. _Git: http://git-scm.com/
78 .. _insider: http://git.tremily.us/?p=insider.git
79 .. _django-tables2: https://github.com/bradleyayers/django-tables2/
80 .. _dt2-docs: http://django-tables2.readthedocs.org/en/latest/
81 .. _BeautifulSoup: http://www.crummy.com/software/BeautifulSoup/
82 .. _Django documentation: https://docs.djangoproject.com/
83 .. _NASDAQ: http://www.nasdaq.com/reference/ownership.stm
84 .. _EDGAR: http://www.edgar-online.com/
85 .. _Django tutorial: https://docs.djangoproject.com/en/1.3/intro/tutorial01/