You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+53-33Lines changed: 53 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,13 +8,9 @@ Amatino gives you a full set of tools to store, organise and retrieve financial
8
8
9
9
## Under construction
10
10
11
-
Right now, the Amatino API offers a full range of accounting services via HTTP requests. However, this Amatino Python library is in an 'Alpha' state. Its capabilities are limited. One class is available: `AmatinoAlpha`.
11
+
Right now, the Amatino API offers a full range of accounting services via HTTP requests. However, this Amatino Python library is in an 'Alpha' state. Its capabilities are limited. A subset of full Amatino features are available.
12
12
13
-
`AmatinoAlpha` is a thin wrapper around asynchronous HTTP requests to the Amatino API. It facilitates testing and experimentation with the Amatino API without having to resort to raw HTTP request manipulation and HMAC computation.
14
-
15
-
Amatino Python will eventually offer expressive, object-oriented interfaces for all Amatino API services. To be notified when Amatino Python enters a Beta state, with all capabilities available, sign up to the [Amatino Development Newsletter](https://amatino.io/newsletter).
16
-
17
-
In the mean time, you may wish to review [Amatino's HTTP documentation](https://amatino.io/documentation) to see what capabilities you can expect from Amatino Python in the future.
13
+
To see what proportion of Amatino features are ready in Amatino Python, check out the [Documentation](https://github.com/amatino-code/amatino-python/wiki/Documentation) page. Linked classes are available, un-linked ones are still under construction.
18
14
19
15
## Installation
20
16
@@ -28,42 +24,65 @@ To use Amatino Python, you will need an active Amatino subscription. You can sta
28
24
29
25
## Example Usage
30
26
31
-
The ````AmatinoAlpha```` object allows you to use the Amatino API without dealing with raw HTTP requests or HMACs. It lacks the expressive syntax, input validation, and error handling that Amatino Python will have in the beta stage.
32
-
33
-
Initialise an `AmatinoAlpha` instance like so:
27
+
The first step is to login to Amatino by creating a [Session](https://github.com/amatino-code/amatino-python/wiki/Session) instance. That Session then becomes your key to using Amatino classes.
34
28
35
-
````Python
36
-
from amatino importAmatinoAlpha
29
+
```python
30
+
from amatino importSession
37
31
38
-
amatino_alpha=AmatinoAlpha(
39
-
email="clever@cookie.com",
40
-
secret="high entropy passphrase"
32
+
session=Session.create_with_email(
33
+
email='clever@cookie.com',
34
+
secret='uncrackable epic passphrase!'
41
35
)
42
-
````
36
+
```
37
+
38
+
Amatino stores financial data inside discrete [Entities](https://github.com/amatino-code/amatino-python/wiki/Entity). An Entity might describe a person, project, company, or some other entity which you wish to describe with financial data.
39
+
40
+
```python
41
+
from amatino import Entity
43
42
44
-
Requests may then be made:
45
-
46
-
````Python
47
-
entity = amatino_alpha.request(
48
-
path="/entities",
49
-
query_string=None,
50
-
method="POST",
51
-
body=[{
52
-
"name": "My First Entity",
53
-
"description": None,
54
-
"region_id": None
55
-
}]
43
+
mega_corporation = Entity.create(
44
+
session=session, # Created above
45
+
name='Mega Corporation'
56
46
)
57
-
````
47
+
```
58
48
59
-
Wherein `path`, `query_string`, `method` and `body` parameters are formed according to the requirements laid out in the [Amatino API HTTP documentation](https://amatino.io/documentation).
49
+
Entities are structured as a hierarchical tree of [Accounts](https://github.com/amatino-code/amatino-python/wiki/Account). You might wish to create a chart of Accounts that mirror the real-world structure of the Entity you are describing.
60
50
61
-
For example, the above request created an [Entity](https://amatino.io/documentation/entities). The requirements for Entity creation are available at https://amatino.io/documentation/entities#action-Create.
51
+
```python
52
+
from amatino import Account
62
53
63
-
For more examples of `AmatinoAlpha` usage, see the [getting started guide](https://amatino.io/articles/getting-started).
54
+
revenue = Account.create(
55
+
session=session,
56
+
entity=mega_corporation, # Created above
57
+
description='Revenue from world domination',
58
+
am_type=AMType.revenue, # An AMType enumeration option
59
+
denomination=USD# A GlobalUnit
60
+
)
61
+
```
62
+
63
+
The real fun begins with [Transactions](https://github.com/amatino-code/amatino-python/wiki/Transaction), where debits and credits come into play
64
+
65
+
```python
66
+
from amatino import Transaction, Entry, Side
67
+
from datetime import datetime
68
+
from decimal import Decimal
69
+
70
+
revenue_recognition = Transaction.create(
71
+
session=session,
72
+
entity=mega_corporation,
73
+
time=datetime.utcnow(),
74
+
entries=[
75
+
Entry(Side.debit, Decimal(10), cash),
76
+
Entry(Side.credit, Decimal(5), revenue),
77
+
Entry(Side.credit, Decimal(5), customer_deposits)
78
+
]
79
+
denomination=USD
80
+
)
81
+
```
64
82
65
-
## API stability & versioning
83
+
Check out the full range of available classes, including Ledgers, in the [Amatino Python documentation](https://github.com/amatino-code/amatino-python/wiki/Documentation)
66
84
85
+
## API stability & versioning
67
86
68
87
Amatino Python obeys the [Semantic Version](https://semver.org) convention. Until v1.0.0, the Python API (not to be confused with the Amatino HTTP API) should be considered unstable and liable to change at any time.
69
88
@@ -84,7 +103,8 @@ Pull requests, comments, issues, forking, and so on are also [most welcome on Gi
0 commit comments