boxd 0.2.13__tar.gz → 0.2.13.dev750__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/src/boxd.egg-info → boxd-0.2.13.dev750}/PKG-INFO +42 -1
  2. {boxd-0.2.13 → boxd-0.2.13.dev750}/README.md +41 -0
  3. {boxd-0.2.13 → boxd-0.2.13.dev750}/pyproject.toml +1 -1
  4. {boxd-0.2.13 → boxd-0.2.13.dev750}/src/boxd/__init__.py +16 -0
  5. {boxd-0.2.13 → boxd-0.2.13.dev750}/src/boxd/_generated/api_pb2.py +145 -125
  6. {boxd-0.2.13 → boxd-0.2.13.dev750}/src/boxd/_generated/api_pb2_grpc.py +132 -0
  7. {boxd-0.2.13 → boxd-0.2.13.dev750}/src/boxd/_mappers.py +85 -0
  8. {boxd-0.2.13 → boxd-0.2.13.dev750}/src/boxd/_requests.py +16 -0
  9. {boxd-0.2.13 → boxd-0.2.13.dev750}/src/boxd/models.py +106 -0
  10. {boxd-0.2.13 → boxd-0.2.13.dev750}/src/boxd/resources/machines.py +62 -0
  11. {boxd-0.2.13 → boxd-0.2.13.dev750}/src/boxd/resources/orgs.py +178 -1
  12. {boxd-0.2.13 → boxd-0.2.13.dev750/src/boxd.egg-info}/PKG-INFO +42 -1
  13. {boxd-0.2.13 → boxd-0.2.13.dev750}/tests/test_namespaces.py +102 -0
  14. {boxd-0.2.13 → boxd-0.2.13.dev750}/LICENSE +0 -0
  15. {boxd-0.2.13 → boxd-0.2.13.dev750}/setup.cfg +0 -0
  16. {boxd-0.2.13 → boxd-0.2.13.dev750}/src/boxd/_client.py +0 -0
  17. {boxd-0.2.13 → boxd-0.2.13.dev750}/src/boxd/_credentials.py +0 -0
  18. {boxd-0.2.13 → boxd-0.2.13.dev750}/src/boxd/_generated/__init__.py +0 -0
  19. {boxd-0.2.13 → boxd-0.2.13.dev750}/src/boxd/_streaming.py +0 -0
  20. {boxd-0.2.13 → boxd-0.2.13.dev750}/src/boxd/_transport.py +0 -0
  21. {boxd-0.2.13 → boxd-0.2.13.dev750}/src/boxd/_urls.py +0 -0
  22. {boxd-0.2.13 → boxd-0.2.13.dev750}/src/boxd/_version_check.py +0 -0
  23. {boxd-0.2.13 → boxd-0.2.13.dev750}/src/boxd/errors.py +0 -0
  24. {boxd-0.2.13 → boxd-0.2.13.dev750}/src/boxd/resources/__init__.py +0 -0
  25. {boxd-0.2.13 → boxd-0.2.13.dev750}/src/boxd/resources/account.py +0 -0
  26. {boxd-0.2.13 → boxd-0.2.13.dev750}/src/boxd/resources/credentials.py +0 -0
  27. {boxd-0.2.13 → boxd-0.2.13.dev750}/src/boxd/resources/disks.py +0 -0
  28. {boxd-0.2.13 → boxd-0.2.13.dev750}/src/boxd/resources/domains.py +0 -0
  29. {boxd-0.2.13 → boxd-0.2.13.dev750}/src/boxd/resources/snapshots.py +0 -0
  30. {boxd-0.2.13 → boxd-0.2.13.dev750}/src/boxd/resources/teams.py +0 -0
  31. {boxd-0.2.13 → boxd-0.2.13.dev750}/src/boxd/resources/vars.py +0 -0
  32. {boxd-0.2.13 → boxd-0.2.13.dev750}/src/boxd.egg-info/SOURCES.txt +0 -0
  33. {boxd-0.2.13 → boxd-0.2.13.dev750}/src/boxd.egg-info/dependency_links.txt +0 -0
  34. {boxd-0.2.13 → boxd-0.2.13.dev750}/src/boxd.egg-info/requires.txt +0 -0
  35. {boxd-0.2.13 → boxd-0.2.13.dev750}/src/boxd.egg-info/top_level.txt +0 -0
  36. {boxd-0.2.13 → boxd-0.2.13.dev750}/tests/test_credentials.py +0 -0
  37. {boxd-0.2.13 → boxd-0.2.13.dev750}/tests/test_mappers.py +0 -0
  38. {boxd-0.2.13 → boxd-0.2.13.dev750}/tests/test_requests.py +0 -0
  39. {boxd-0.2.13 → boxd-0.2.13.dev750}/tests/test_streaming.py +0 -0
  40. {boxd-0.2.13 → boxd-0.2.13.dev750}/tests/test_transport.py +0 -0
  41. {boxd-0.2.13 → boxd-0.2.13.dev750}/tests/test_urls.py +0 -0
  42. {boxd-0.2.13 → boxd-0.2.13.dev750}/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
3
+ Version: 0.2.13.dev750
4
4
  Summary: Python SDK for the boxd cloud VM platform
5
5
  Author: Azin
6
6
  License-Expression: MIT
@@ -56,6 +56,10 @@ boxd.machines.wait_until_ready(machine.id)
56
56
  result = boxd.machines.exec(machine.id, "uname -a")
57
57
  print(result.stdout)
58
58
 
59
+ # What it cost (metered every few minutes; still answers after delete):
60
+ usage = boxd.machines.usage(machine.id)
61
+ print(usage.cost_micro / 1e6, usage.currency)
62
+
59
63
  boxd.machines.delete(machine.id)
60
64
  boxd.close()
61
65
  ```
@@ -753,6 +757,43 @@ cfg = boxd.account.config()
753
757
  cfg.default_image, cfg.zone
754
758
  ```
755
759
 
760
+ ## Usage and cost
761
+
762
+ What each machine used and cost, and what was actually charged. Org owners
763
+ and admins only; an API key issued for the org works too.
764
+
765
+ ```python
766
+ from datetime import datetime, timezone
767
+
768
+ # One machine over its whole life, or pass since=/until= (datetime or unix
769
+ # seconds). A deleted machine is found by its id.
770
+ u = boxd.machines.usage("my-machine")
771
+ u.seconds.running, u.seconds.standby, u.seconds.hibernated, u.seconds.stopped
772
+ u.cost_micro / 1e6 # estimated cost, in u.currency ("eur" | "usd")
773
+ u.period.start, u.period.end
774
+ u.vcpu_hours, u.ram_gib_hours, u.disk_gib_hours # what the cost is priced on
775
+ u.rates # ...at these rates, per unit-hour
776
+
777
+ # Every machine in an org, most expensive first. Default: the last 28 days.
778
+ r = boxd.orgs.usage(since=datetime(2026, 9, 1, tzinfo=timezone.utc))
779
+ r.total_cost_micro, r.currency
780
+ for m in r.machines:
781
+ print(m.name, m.status, m.cost_micro / 1e6)
782
+
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)):
785
+ print(e.created_at, e.kind, e.amount_micro / 1e6) # charges are negative
786
+ ```
787
+
788
+ Money is in micro-units (1e-6) of the org's currency. Usage is metered in
789
+ 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
791
+ `usage_charge` per 15 minutes for the whole org, plus top-ups and grants).
792
+ 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
794
+ `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(): ...`).
796
+
756
797
  ## Errors
757
798
 
758
799
  ```python
@@ -24,6 +24,10 @@ boxd.machines.wait_until_ready(machine.id)
24
24
  result = boxd.machines.exec(machine.id, "uname -a")
25
25
  print(result.stdout)
26
26
 
27
+ # What it cost (metered every few minutes; still answers after delete):
28
+ usage = boxd.machines.usage(machine.id)
29
+ print(usage.cost_micro / 1e6, usage.currency)
30
+
27
31
  boxd.machines.delete(machine.id)
28
32
  boxd.close()
29
33
  ```
@@ -721,6 +725,43 @@ cfg = boxd.account.config()
721
725
  cfg.default_image, cfg.zone
722
726
  ```
723
727
 
728
+ ## Usage and cost
729
+
730
+ What each machine used and cost, and what was actually charged. Org owners
731
+ and admins only; an API key issued for the org works too.
732
+
733
+ ```python
734
+ from datetime import datetime, timezone
735
+
736
+ # One machine over its whole life, or pass since=/until= (datetime or unix
737
+ # seconds). A deleted machine is found by its id.
738
+ u = boxd.machines.usage("my-machine")
739
+ u.seconds.running, u.seconds.standby, u.seconds.hibernated, u.seconds.stopped
740
+ u.cost_micro / 1e6 # estimated cost, in u.currency ("eur" | "usd")
741
+ u.period.start, u.period.end
742
+ u.vcpu_hours, u.ram_gib_hours, u.disk_gib_hours # what the cost is priced on
743
+ u.rates # ...at these rates, per unit-hour
744
+
745
+ # Every machine in an org, most expensive first. Default: the last 28 days.
746
+ r = boxd.orgs.usage(since=datetime(2026, 9, 1, tzinfo=timezone.utc))
747
+ r.total_cost_micro, r.currency
748
+ for m in r.machines:
749
+ print(m.name, m.status, m.cost_micro / 1e6)
750
+
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)):
753
+ print(e.created_at, e.kind, e.amount_micro / 1e6) # charges are negative
754
+ ```
755
+
756
+ Money is in micro-units (1e-6) of the org's currency. Usage is metered in
757
+ 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
759
+ `usage_charge` per 15 minutes for the whole org, plus top-ups and grants).
760
+ 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
762
+ `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(): ...`).
764
+
724
765
  ## Errors
725
766
 
726
767
  ```python
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "boxd"
3
- version = "0.2.13"
3
+ version = "0.2.13.dev750"
4
4
  description = "Python SDK for the boxd cloud VM platform"
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -53,6 +53,8 @@ from .models import (
53
53
  EnvVar,
54
54
  ExecResult,
55
55
  ExposedPort,
56
+ LedgerEntry,
57
+ LedgerPage,
56
58
  Machine,
57
59
  MachineAccess,
58
60
  MachineIdle,
@@ -61,6 +63,8 @@ from .models import (
61
63
  MachineSource,
62
64
  MachineSourceKind,
63
65
  MachineStatus,
66
+ MachineUsage,
67
+ MachineUsageReport,
64
68
  Org,
65
69
  OrgDomain,
66
70
  OrgInvite,
@@ -69,6 +73,7 @@ from .models import (
69
73
  OrgMembers,
70
74
  OrgRef,
71
75
  OrgRole,
76
+ OrgUsage,
72
77
  PauseResult,
73
78
  Proxy,
74
79
  ProxyEntry,
@@ -77,8 +82,11 @@ from .models import (
77
82
  ResumeResult,
78
83
  Secret,
79
84
  Snapshot,
85
+ StateSeconds,
80
86
  Team,
81
87
  TeamMember,
88
+ UsagePeriod,
89
+ UsageRates,
82
90
  VarScope,
83
91
  VolumeMount,
84
92
  )
@@ -122,6 +130,8 @@ __all__ = [
122
130
  "EnvVar",
123
131
  "ExecResult",
124
132
  "ExposedPort",
133
+ "LedgerEntry",
134
+ "LedgerPage",
125
135
  "Machine",
126
136
  "MachineAccess",
127
137
  "MachineIdle",
@@ -130,6 +140,8 @@ __all__ = [
130
140
  "MachineSource",
131
141
  "MachineSourceKind",
132
142
  "MachineStatus",
143
+ "MachineUsage",
144
+ "MachineUsageReport",
133
145
  "Org",
134
146
  "OrgDomain",
135
147
  "OrgInvite",
@@ -138,6 +150,7 @@ __all__ = [
138
150
  "OrgMembers",
139
151
  "OrgRef",
140
152
  "OrgRole",
153
+ "OrgUsage",
141
154
  "PauseResult",
142
155
  "Proxy",
143
156
  "ProxyEntry",
@@ -146,8 +159,11 @@ __all__ = [
146
159
  "ResumeResult",
147
160
  "Secret",
148
161
  "Snapshot",
162
+ "StateSeconds",
149
163
  "Team",
150
164
  "TeamMember",
165
+ "UsagePeriod",
166
+ "UsageRates",
151
167
  "VarScope",
152
168
  "VolumeMount",
153
169
  # Errors