boxd 0.2.13.dev750__tar.gz → 0.2.13.dev755__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. {boxd-0.2.13.dev750/src/boxd.egg-info → boxd-0.2.13.dev755}/PKG-INFO +24 -7
  2. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/README.md +23 -6
  3. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/pyproject.toml +1 -1
  4. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/__init__.py +4 -4
  5. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/_generated/api_pb2.py +140 -140
  6. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/_generated/api_pb2_grpc.py +14 -14
  7. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/_mappers.py +7 -5
  8. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/models.py +13 -6
  9. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/resources/machines.py +12 -2
  10. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/resources/orgs.py +28 -28
  11. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755/src/boxd.egg-info}/PKG-INFO +24 -7
  12. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/tests/test_namespaces.py +11 -9
  13. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/LICENSE +0 -0
  14. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/setup.cfg +0 -0
  15. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/_client.py +0 -0
  16. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/_credentials.py +0 -0
  17. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/_generated/__init__.py +0 -0
  18. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/_requests.py +0 -0
  19. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/_streaming.py +0 -0
  20. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/_transport.py +0 -0
  21. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/_urls.py +0 -0
  22. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/_version_check.py +0 -0
  23. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/errors.py +0 -0
  24. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/resources/__init__.py +0 -0
  25. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/resources/account.py +0 -0
  26. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/resources/credentials.py +0 -0
  27. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/resources/disks.py +0 -0
  28. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/resources/domains.py +0 -0
  29. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/resources/snapshots.py +0 -0
  30. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/resources/teams.py +0 -0
  31. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd/resources/vars.py +0 -0
  32. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd.egg-info/SOURCES.txt +0 -0
  33. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd.egg-info/dependency_links.txt +0 -0
  34. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd.egg-info/requires.txt +0 -0
  35. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/src/boxd.egg-info/top_level.txt +0 -0
  36. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/tests/test_credentials.py +0 -0
  37. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/tests/test_mappers.py +0 -0
  38. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/tests/test_requests.py +0 -0
  39. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/tests/test_streaming.py +0 -0
  40. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/tests/test_transport.py +0 -0
  41. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/tests/test_urls.py +0 -0
  42. {boxd-0.2.13.dev750 → boxd-0.2.13.dev755}/tests/test_version_check.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: boxd
3
- Version: 0.2.13.dev750
3
+ Version: 0.2.13.dev755
4
4
  Summary: Python SDK for the boxd cloud VM platform
5
5
  Author: Azin
6
6
  License-Expression: MIT
@@ -766,10 +766,11 @@ and admins only; an API key issued for the org works too.
766
766
  from datetime import datetime, timezone
767
767
 
768
768
  # One machine over its whole life, or pass since=/until= (datetime or unix
769
- # seconds). A deleted machine is found by its id.
769
+ # seconds). A deleted machine is found by its id or name (org= says where to look).
770
770
  u = boxd.machines.usage("my-machine")
771
771
  u.seconds.running, u.seconds.standby, u.seconds.hibernated, u.seconds.stopped
772
772
  u.cost_micro / 1e6 # estimated cost, in u.currency ("eur" | "usd")
773
+ u.complete # True once all its usage is metered (see below)
773
774
  u.period.start, u.period.end
774
775
  u.vcpu_hours, u.ram_gib_hours, u.disk_gib_hours # what the cost is priced on
775
776
  u.rates # ...at these rates, per unit-hour
@@ -780,19 +781,35 @@ r.total_cost_micro, r.currency
780
781
  for m in r.machines:
781
782
  print(m.name, m.status, m.cost_micro / 1e6)
782
783
 
783
- # The credit ledger: what was actually charged, newest first.
784
- for e in boxd.orgs.ledger(since=datetime(2026, 9, 1, tzinfo=timezone.utc)):
784
+ # Billing activity: what was actually charged, newest first.
785
+ for e in boxd.orgs.billing_activity(since=datetime(2026, 9, 1, tzinfo=timezone.utc)):
785
786
  print(e.created_at, e.kind, e.amount_micro / 1e6) # charges are negative
786
787
  ```
787
788
 
789
+ To record what a machine cost after deleting it, wait for `complete`:
790
+ metering lags by up to ~25 minutes, so the figure read right after `delete()`
791
+ is still growing.
792
+
793
+ ```python
794
+ boxd.machines.delete(machine_id)
795
+ # ...a little later, or from a periodic job:
796
+ u = boxd.machines.usage(machine_id)
797
+ if u.complete:
798
+ save(machine_id, u.cost_micro, u.currency) # otherwise try again later
799
+ ```
800
+
801
+ `orgs.usage()` carries the same flag on every machine, so one periodic call can
802
+ settle all of them. A machine that still exists is never complete in a window
803
+ that runs to now.
804
+
788
805
  Money is in micro-units (1e-6) of the org's currency. Usage is metered in
789
806
  15-minute buckets and priced at the org's current rates, so it is an estimate
790
- that tracks the ledger closely; the ledger is what was charged (one
807
+ that tracks billing activity closely; billing activity is what was charged (one
791
808
  `usage_charge` per 15 minutes for the whole org, plus top-ups and grants).
792
809
  Machines deleted since still show up, with status `"deleted"`. A window spans
793
- at most 366 days. `orgs.ledger_page()` returns one page with its
810
+ at most 366 days. `orgs.billing_activity_page()` returns one page with its
794
811
  `next_page_token` when you want to page by hand. The async client has the
795
- same methods (`async for e in boxd.orgs.ledger(): ...`).
812
+ same methods (`async for e in boxd.orgs.billing_activity(): ...`).
796
813
 
797
814
  ## Errors
798
815
 
@@ -734,10 +734,11 @@ and admins only; an API key issued for the org works too.
734
734
  from datetime import datetime, timezone
735
735
 
736
736
  # One machine over its whole life, or pass since=/until= (datetime or unix
737
- # seconds). A deleted machine is found by its id.
737
+ # seconds). A deleted machine is found by its id or name (org= says where to look).
738
738
  u = boxd.machines.usage("my-machine")
739
739
  u.seconds.running, u.seconds.standby, u.seconds.hibernated, u.seconds.stopped
740
740
  u.cost_micro / 1e6 # estimated cost, in u.currency ("eur" | "usd")
741
+ u.complete # True once all its usage is metered (see below)
741
742
  u.period.start, u.period.end
742
743
  u.vcpu_hours, u.ram_gib_hours, u.disk_gib_hours # what the cost is priced on
743
744
  u.rates # ...at these rates, per unit-hour
@@ -748,19 +749,35 @@ r.total_cost_micro, r.currency
748
749
  for m in r.machines:
749
750
  print(m.name, m.status, m.cost_micro / 1e6)
750
751
 
751
- # The credit ledger: what was actually charged, newest first.
752
- for e in boxd.orgs.ledger(since=datetime(2026, 9, 1, tzinfo=timezone.utc)):
752
+ # Billing activity: what was actually charged, newest first.
753
+ for e in boxd.orgs.billing_activity(since=datetime(2026, 9, 1, tzinfo=timezone.utc)):
753
754
  print(e.created_at, e.kind, e.amount_micro / 1e6) # charges are negative
754
755
  ```
755
756
 
757
+ To record what a machine cost after deleting it, wait for `complete`:
758
+ metering lags by up to ~25 minutes, so the figure read right after `delete()`
759
+ is still growing.
760
+
761
+ ```python
762
+ boxd.machines.delete(machine_id)
763
+ # ...a little later, or from a periodic job:
764
+ u = boxd.machines.usage(machine_id)
765
+ if u.complete:
766
+ save(machine_id, u.cost_micro, u.currency) # otherwise try again later
767
+ ```
768
+
769
+ `orgs.usage()` carries the same flag on every machine, so one periodic call can
770
+ settle all of them. A machine that still exists is never complete in a window
771
+ that runs to now.
772
+
756
773
  Money is in micro-units (1e-6) of the org's currency. Usage is metered in
757
774
  15-minute buckets and priced at the org's current rates, so it is an estimate
758
- that tracks the ledger closely; the ledger is what was charged (one
775
+ that tracks billing activity closely; billing activity is what was charged (one
759
776
  `usage_charge` per 15 minutes for the whole org, plus top-ups and grants).
760
777
  Machines deleted since still show up, with status `"deleted"`. A window spans
761
- at most 366 days. `orgs.ledger_page()` returns one page with its
778
+ at most 366 days. `orgs.billing_activity_page()` returns one page with its
762
779
  `next_page_token` when you want to page by hand. The async client has the
763
- same methods (`async for e in boxd.orgs.ledger(): ...`).
780
+ same methods (`async for e in boxd.orgs.billing_activity(): ...`).
764
781
 
765
782
  ## Errors
766
783
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "boxd"
3
- version = "0.2.13.dev750"
3
+ version = "0.2.13.dev755"
4
4
  description = "Python SDK for the boxd cloud VM platform"
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -53,8 +53,8 @@ from .models import (
53
53
  EnvVar,
54
54
  ExecResult,
55
55
  ExposedPort,
56
- LedgerEntry,
57
- LedgerPage,
56
+ BillingActivityEntry,
57
+ BillingActivityPage,
58
58
  Machine,
59
59
  MachineAccess,
60
60
  MachineIdle,
@@ -130,8 +130,8 @@ __all__ = [
130
130
  "EnvVar",
131
131
  "ExecResult",
132
132
  "ExposedPort",
133
- "LedgerEntry",
134
- "LedgerPage",
133
+ "BillingActivityEntry",
134
+ "BillingActivityPage",
135
135
  "Machine",
136
136
  "MachineAccess",
137
137
  "MachineIdle",