M .github/README.md +3 -3
@@ 20,11 20,11 @@ Using **python-ccb** is very simple:
```python
- import ccb
+ import python_ccb
- session = ccb.ClearCheckBook('user', 'passwd')
+ session = python_ccb.ClearCheckBook('user', 'passwd')
account = session.get_account('My Account')
- new_tran = ccb.Transaction('Something', 50, ccb.WITHDRAW, account=account)
+ new_tran = python_ccb.Transaction('Something', 50, python_ccb.WITHDRAW, account=account)
session.insert_transaction(new_tran)
```
M README.md +3 -3
@@ 17,11 17,11 @@ Using **python-ccb** is very simple:
```python
- import ccb
+ import python_ccb
- session = ccb.ClearCheckBook('user', 'passwd')
+ session = python_ccb.ClearCheckBook('user', 'passwd')
account = session.get_account('My Account')
- new_tran = ccb.Transaction('Something', 50, ccb.WITHDRAW, account=account)
+ new_tran = python_ccb.Transaction('Something', 50, python_ccb.WITHDRAW, account=account)
session.insert_transaction(new_tran)
```
M docs/reference.md +7 -6
@@ 1,31 1,31 @@
# Reference
-::: ccb.ClearCheckBook
+::: python_ccb.ClearCheckBook
rendering:
show_root_heading: true
-::: ccb.Account
+::: python_ccb.Account
selection:
filters: ["!^_"]
rendering:
show_root_heading: true
show_source: false
-::: ccb.Category
+::: python_ccb.Category
selection:
filters: ["!^_"]
rendering:
show_root_heading: true
show_source: false
-::: ccb.Currency
+::: python_ccb.Currency
selection:
filters: ["!^_"]
rendering:
show_root_heading: true
show_source: false
-::: ccb.Transaction
+::: python_ccb.Transaction
selection:
filters: ["!^_"]
rendering:
@@ 34,7 34,8 @@
# Account and transaction constants
-The following account and transaction codes are numeric constants importable from `ccb`.
+The following account and transaction codes are numeric constants importable
+from `python_ccb`.
| Constant | Description |
|:------------ |:-------------------------------------------------------------- |
M docs/usage.md +14 -14
@@ 14,28 14,28 @@ ClearCheBook class accepts three paramet
The simplest use case is getting all transactions:
```python
-import ccb
+import python_ccb
-session = ccb.ClearCheckBook('user', 'passwd')
+session = python_ccb.ClearCheckBook('user', 'passwd')
for transaction in session.get_transactions():
print(transaction)
```
-[`get_transactions`](reference.md#ccb.ClearCheckBook.get_transaction) is an iterator
+[`get_transactions`](reference.md#python_ccb.ClearCheckBook.get_transaction) is an iterator
that gets all transactions. To get all transactions for an account, add the account
parameter like this:
```python
-import ccb
+import python_ccb
-session = ccb.ClearCheckBook('user', 'passwd')
+session = python_ccb.ClearCheckBook('user', 'passwd')
account = session.get_account('My Account')
for transaction in session.get_transactions(account=account):
print(f'Transaction: {transaction.description}, amount: {transaction.amount}')
```
-[`Transaction`](reference.md#ccb.Transaction) objects represents a transaction from
+[`Transaction`](reference.md#python_ccb.Transaction) objects represents a transaction from
ClearCheckBook. All the propierties are documented in the [Reference](reference.md) page
### Insert a transaction
@@ 43,12 43,12 @@ ClearCheckBook. All the propierties are
Inserting a transaction is fairly simple too:
```python
-import ccb
+import python_ccb
-session = ccb.ClearCheckBook('user', 'passwd')
+session = python_ccb.ClearCheckBook('user', 'passwd')
account = session.get_account('My Account')
category = session.get_account('My Category')
-new_tran = ccb.Transaction('Description', 50, account, category)
+new_tran = python_ccb.Transaction('Description', 50, account, category)
new_tran = session.insert_transaction(new_tran)
print(f'Transaction ID: {new_ran.id}'
@@ 58,10 58,10 @@ If the transaction you want to insert do
special `NO_ACCOUNT` or `NO_CATEGORY` can be used instead:
```python
-import ccb
+import python_ccb
-session = ccb.ClearCheckBook('user', 'passwd')
-new_tran = ccb.Transaction('Description', 50, ccb.NO_ACCOUNT, CCB.NO_CATEGORY)
+session = python_ccb.ClearCheckBook('user', 'passwd')
+new_tran = python_ccb.Transaction('Description', 50, python_ccb.NO_ACCOUNT, CCB.NO_CATEGORY)
new_tran = session.insert_transaction(new_tran)
if aa == '1':
print('HOLA')
@@ 73,9 73,9 @@ print(f'Transaction ID: {new_ran.id}'
To edit a transaction the first thing is to get its ID, then it's very straighforward:
```python
-import ccb
+import python_ccb
-session = ccb.ClearCheckBook('user', 'passwd')
+session = python_ccb.ClearCheckBook('user', 'passwd')
for transaction in session.get_transactions():
if transaction.description == 'Thing I'm Looking For':
M pyproject.toml +1 -1
@@ 1,5 1,5 @@
[tool.poetry]
-name = "python-ccb"
+name = "ccb"
version = "1"
description = "Python wrapper for clearcheckbook"
authors = ["Oscar Curero <oscar@curero.es>"]