Amatino

Latest version: v0.0.19

Safety actively analyzes 685525 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

0.0.18

v0.0.18 makes the following changes. Code currently running on v0.0.16 should generally be backwards compatible with v0.0.18.

- Requests for resources that Amatino API cannot find will now raise a `ResourceNotFound` error, rather than a generic urllib.HTTPError. ResourceNotFound is a subclass of AmatinoError, allowing you to catch non-existent resources along with other Amatino library exceptions.
- Internally, `ApiRequest.response_data` is now immutable
- In previous versions, ApiRequest responded to an undocumented command line argument `--debug`. This argument is common and may clash with application command line arguments, causing unexpected behaviour. The argument has been renamed `--amatino-debug`.
- `GlobalUnit` no longer has a .session property
- `GlobalUnit` now implements the equality operator via `__eq__()`
- Added a new class: `GlobalUnitConstants`, which enumerates a subset of common `GlobalUnits`. For example:

python
Previously, the only way to get USD was...
usd = GlobalUnit.retrieve(5, session)
Now you can also...
usd = GlobalUnitConstants.USD


Install Amatino Python [via Pip](https://pypi.org/project/amatino/):


pip install --upgrade amatino


**Note**: 0.0.18 patches an import bug included in 0.0.17. For simplicity's sake, the 0.0.17 changelog has been renamed to 0.0.18.

0.0.16

0.0.16 adds `Entity` listing, compatible with Amatino API 0.0.19. You can retrieve lists of Entities, and search them by name.

Changelog
- Added `Entity.retrieve_list() -> List[Entity]` method
- Fixed bad type annotation, `Entity.retrieve()` now hints at return type of `Optional[Entity]`
- Added `Disposition` class
- Added `Entity.disposition` property
- Remove debug print from `Signature` computation

Listing example
python
great_entities = Entity.retrieve_list(
session=session, Instance of `amatino.Session` created elsewhere
name='great' Find Entities whose name contains "great"
)


Listed Entities have a `.disposition` property, itself an object with integer properties `.count`, `.sequence`, `.limit`, and `.offset`, which together define the position of an Entity within a list of Entities.

Installation

Install / upgrade `Amatino` via [PyPi](https://pypi.org/project/amatino/):

bash
pip install --upgrade amatino

0.0.15

0.0.15 removes JSON bodies from HMAC calculations, for compatibility with Amatino API 0.0.18. There are no public facing changes in 0.0.15, and code written for 0.0.14 will continue to run as before.

0.0.14

This is a small release that fixes some out-of-spec behaviour by `Entity`. `Entity` was internally using some undocumented coding keys, and exposing an undocumented `.active` property.

0.0.13

![](https://content.amatino.io/blog/wp-content/uploads/2019/03/27142021/20190327_AM_Python_0.0.13.jpg)

Rejoice, Pythonistas! A new version of the Amatino Python library is now available. 0.0.13 adds new capabilities. Amatino Python is now nearing initial feature completion, with almost all existing API classes covered. Watch out, 0.0.13 is<strong> catastrophically breaking</strong>, many method signatures have changed and code written for 0.0.12 will not work.

Why all the breaks? Many methods in 0.0.12 required the provision of a <code>Session</code> independent of an <code>Entity</code>, despite that <code>Entity</code> having ready access to the <code>Session</code> used when it was itself initialised. This redundancy was needlessly verbose.
<ul>
<li>Add new <code>UserList</code> class</li>
<li>Add <code>User.delete()</code>, <code>.create()</code>, and <code>.create_many()</code> method</li>
<li>Add <code>TransactionVersionList</code> class</li>
<li>Conform <code>Ledger</code> to <code>collections.Sequence</code></li>
<li>Simplify <code>Ledger</code>, <code>Balance</code>, <code>Account</code>, and <code>Transaction</code> method signatures: No more <code>Session</code> requirement</li>
<li>Publicise <code>User.decode_many()</code> method</li>
<li>Conform <code>Transaction</code> to <code>collections.Sequence</code></li>
<li>Add <code>Transaction.magnitude</code> property</li>
<li>Conform <code>Balance</code> and <code>RecursiveBalance</code> to <code>Denominated</code> protocol</li>
<li>Conform <code>Ledger</code> and <code>RecursiveLedger</code> to <code>Denominated</code> protocol</li>
</ul>
<code>Ledger</code> and <code>Transaction</code> may be now be directly iterated over, revealing constituent <code>LedgerRows</code> and <code>Entries</code> respectively. They may also be subscripted.

An example using <code>Ledger</code>:

python
ledger = Ledger.retrieve(
entity=mega_corp,
account=revenue
)

for row in ledger:
print("[{date}] {balance}".format(
date=row.transaction.time.strftime("%Y-%m-%d"),
balance='{:,.2f}'.format(row.balance)
))

print("Last row balance: {balance}".format(
balance='{:,.2f}'.format(ledger[-1].balance)
))


And <code>Transaction</code>:

python
sale = Transaction.retrieve(
entity=mega_corp,
id_=42,
denomination=USD
)

print("Largest single entry: {amount}".format(
amount='{:,2f}'.format(
max([entry.amount for entry in sale])
)
))


The new UserList allows you to retrieve all white-labels managed by your billing account. Draw on the <code>State</code> enum to refine the retrieval to all, deleted, or active users.

python
active_users = UserList(
session=session,
state=State.active
)

print("Currently paying for {num} users".format(
num=str(len(active_users))
))


Review the history of modifications to a <code>Transaction</code> using the <code>TransactionVersionList</code>.

python
versions = TransactionVersionList.retrieve(
entity=mega_corp,
transaction=big_sale
)

for version in versions:
print("{time}: {magnitude}".format(
time=version.version_time.strftime("%Y-%m-%d"),
magnitude='{:,2f}'.format(version.magnitude)
)


For detailed documentation of the properties and methods of all Amatino classes, check out the <a href="https://github.com/amatino-code/amatino-python/wiki/Documentation">Amatino Python Documentation</a>.

You can install <a href="https://pypi.org/project/amatino/">Amatino via PyPi</a>:
<pre>$ pip install amatino</pre>
Or, if you already have Amatino Python installed, upgrade:
<pre>$ pip install --upgrade amatino</pre>
Your feedback is most welcome on the <a href="https://amatino.io/discussion">Amatino discussion forums</a>, or <a href="https://twitter.com/amatinoapi">on Twitter</a>.

0.0.12

![](https://content.amatino.io/blog/wp-content/uploads/2019/03/20064444/20190320_AM_Python_0.0.12.jpg)

Hot on the heels of <a href="https://amatino.io/blog/amatino-python-0-0-11-released/">0.0.11</a>, Amatino Python 0.0.12 has been released. 0.0.12 enhances the capabilities of the <code>Position</code> and <code>Performance</code> classes added in 0.0.11, and introduces the new <code>Tree</code> class.
<ul>
<li>Add <code>Tree</code> class</li>
<li>Add total account balance properties to <code>Performance</code></li>
<li>Add total account balance properties to <code>Position</code></li>
<li>Add tests for all new features</li>
</ul>
The new properties in <code>Position</code> and <code>Performance</code> give you quick access to key financial data describing an entity.

python
print("{name} total assets: ${assets}".format(
name=mega_corp.name,
assets='{:,}'.format(position.total_assets)
)
Example output:
Mega Corp total assets: $1,543

Check out the [Amatino Python documentation](https://github.com/amatino-code/amatino-python/wiki/Documentation) to see all the new properties.

The new <code>Tree</code> class is a beast, combining all accounts in an entity into a single recursive object, at a particular balance date. Like <code>Position</code> and <code>Performance</code>, <code>Tree</code> accounts are of type <code>TreeNode</code>, which means you have access to recursive and individual balances and other useful data.

python
from amatino import Tree
from datetime import datetime

tree = Tree.retrieve(
entity=mega_corp,
balance_time=datetime.utcnow()
)

print("{name} equity: ${equity}".format(
name=mega_corp.name,
equity='{:,}'.format(tree.total_equity)
)


For detailed documentation of the properties and methods of the Tree class, check out the <a href="https://github.com/amatino-code/amatino-python/wiki/Documentation/Tree">Amatino Python Documentation</a>.

You can install Amatino via PyPi:
<pre>$ pip install amatino</pre>
Or, if you already have Amatino Python installed, upgrade:
<pre>$ pip install --upgrade amatino</pre>
Be sure to leave your feedback on the <a href="https://amatino.io/discussion">Amatino discussion forums</a>, or <a href="https://twitter.com/amatinoapi">on Twitter</a>, we'd love to hear what you think about Amatino Python.

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.