Skip to content

Commit 50da0b7

Browse files
committed
update ReadMe to reflect 0.0.7 standard
1 parent 4645d3a commit 50da0b7

1 file changed

Lines changed: 53 additions & 33 deletions

File tree

readme.md

Lines changed: 53 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,9 @@ Amatino gives you a full set of tools to store, organise and retrieve financial
88

99
## Under construction
1010

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.
1212

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.
1814

1915
## Installation
2016

@@ -28,42 +24,65 @@ To use Amatino Python, you will need an active Amatino subscription. You can sta
2824

2925
## Example Usage
3026

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.
3428

35-
````Python
36-
from amatino import AmatinoAlpha
29+
```python
30+
from amatino import Session
3731

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!'
4135
)
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
4342

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'
5646
)
57-
````
47+
```
5848

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.
6050

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
6253

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+
```
6482

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)
6684

85+
## API stability & versioning
6786

6887
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.
6988

@@ -84,7 +103,8 @@ Pull requests, comments, issues, forking, and so on are also [most welcome on Gi
84103
- [Development newsletter](https://amatino.io/newsletter)
85104
- [Discussion forum](https://amatino.io/discussion)
86105
- [More Amatino client libraries](https://github.com/amatino-code)
87-
- [Documentation](https://amatino.io/documentation)
106+
- [HTTP Documentation](https://amatino.io/documentation)
107+
- [Python Documentation](https://github.com/amatino-code/amatino-python/wiki/Documentation)
88108
- [Billing and account management](https://amatino.io/billing)
89109
- [About Amatino Pty Ltd](https://amatino.io/about)
90110

0 commit comments

Comments
 (0)