pdc-api 0.4.1__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 (44) hide show
  1. pdc_api-0.4.1/CHANGELOG.md +58 -0
  2. pdc_api-0.4.1/LICENSE +661 -0
  3. pdc_api-0.4.1/PKG-INFO +276 -0
  4. pdc_api-0.4.1/README.md +243 -0
  5. pdc_api-0.4.1/codegen/postprocess.py +17 -0
  6. pdc_api-0.4.1/codegen/preprocess.py +159 -0
  7. pdc_api-0.4.1/integration_tests/conftest.py +146 -0
  8. pdc_api-0.4.1/integration_tests/test_application_form_input_type_contract.py +65 -0
  9. pdc_api-0.4.1/integration_tests/test_default_permission_grants.py +79 -0
  10. pdc_api-0.4.1/integration_tests/test_ensure_for_keycloak_org.py +37 -0
  11. pdc_api-0.4.1/integration_tests/test_group_membership.py +78 -0
  12. pdc_api-0.4.1/integration_tests/test_keycloak_admin.py +100 -0
  13. pdc_api-0.4.1/integration_tests/test_operations.py +609 -0
  14. pdc_api-0.4.1/integration_tests/test_permission_grants.py +339 -0
  15. pdc_api-0.4.1/integration_tests/test_preprocess_rules.py +57 -0
  16. pdc_api-0.4.1/integration_tests/test_seed.py +123 -0
  17. pdc_api-0.4.1/just/pdc.just +33 -0
  18. pdc_api-0.4.1/justfile +113 -0
  19. pdc_api-0.4.1/pyproject.toml +167 -0
  20. pdc_api-0.4.1/pyproject.toml.orig +113 -0
  21. pdc_api-0.4.1/src/pdc_api/__init__.py +37 -0
  22. pdc_api-0.4.1/src/pdc_api/_base.py +6 -0
  23. pdc_api-0.4.1/src/pdc_api/_generated.py +873 -0
  24. pdc_api-0.4.1/src/pdc_api/client.py +332 -0
  25. pdc_api-0.4.1/src/pdc_api/errors.py +61 -0
  26. pdc_api-0.4.1/src/pdc_api/models.py +136 -0
  27. pdc_api-0.4.1/src/pdc_api/openapi.json +7947 -0
  28. pdc_api-0.4.1/src/pdc_api/permission_grants.py +307 -0
  29. pdc_api-0.4.1/src/pdc_api/py.typed +0 -0
  30. pdc_api-0.4.1/src/pdc_api/seeding/__init__.py +0 -0
  31. pdc_api-0.4.1/src/pdc_api/seeding/keycloak_admin.py +179 -0
  32. pdc_api-0.4.1/src/pdc_api/seeding/pdc_entities.py +711 -0
  33. pdc_api-0.4.1/src/pdc_api/testing.py +314 -0
  34. pdc_api-0.4.1/src/pdc_api/token.py +69 -0
  35. pdc_api-0.4.1/src/pdc_api/transport.py +100 -0
  36. pdc_api-0.4.1/tests/conftest.py +65 -0
  37. pdc_api-0.4.1/tests/test_client.py +244 -0
  38. pdc_api-0.4.1/tests/test_client_files.py +69 -0
  39. pdc_api-0.4.1/tests/test_client_operations.py +356 -0
  40. pdc_api-0.4.1/tests/test_keycloak_admin.py +21 -0
  41. pdc_api-0.4.1/tests/test_models.py +24 -0
  42. pdc_api-0.4.1/tests/test_permission_grants.py +178 -0
  43. pdc_api-0.4.1/tests/test_token.py +99 -0
  44. pdc_api-0.4.1/tests/test_transport.py +127 -0
@@ -0,0 +1,58 @@
1
+ # Changelog
2
+
3
+ This project follows [Semantic Versioning](https://semver.org). Until 1.0, a minor version may include breaking changes.
4
+
5
+ PDC does not bump its spec version for every API change, so each entry names the spec version and the date the spec was downloaded.
6
+
7
+ ## 0.4.1 (2026-11-20)
8
+
9
+ - `pdc-api` is published on [PyPI](https://pypi.org/project/pdc-api/). Install it with `pip install pdc-api`.
10
+
11
+ ## 0.4.0 (2026-11-19)
12
+
13
+ Breaking changes that make names consistent before a wider release:
14
+
15
+ - The distribution is now `pdc-api` (was `pdc-python-client`), the import name is `pdc_api` (was `pdc_api_client`), and the repository is `PhilanthropyDataCommons/pdc-api-python`.
16
+ - `get_basefields` is now `get_base_fields`, `create_changemaker_proposal` is `create_proposal`, `create_changemaker_proposal_version` is `create_proposal_version`, and `register_file_upload` is `create_file`.
17
+ - `get_application_form` takes `application_form_id` instead of `form_id`.
18
+ - `list_permission_grants` filters by `changemaker_id`, `funder_short_code`, and `proposal_id` instead of `changemaker`, `funder`, and `proposal`.
19
+ - The permission grant create and update functions take `grant` instead of `spec`.
20
+ - `ProposalNotFoundError`, `ChangemakerNotFoundError`, `FunderNotFoundError`, and `ChangemakerFieldValueBatchNotFoundError` now subclass `PDCNotFoundError`, and their `.detail` names the missing resource.
21
+ - Seeding's `ensure_funder_for_kc_org`, `ensure_changemaker_for_kc_org`, and `ensure_data_provider_for_kc_org` are now `ensure_*_for_keycloak_org`, with a `keycloak_org` argument.
22
+ - Seeding drops its own `link_changemaker_to_proposal`; use the client function of the same name.
23
+
24
+ Other changes:
25
+
26
+ - `ChangemakerFieldValueBatchNotFoundError` and `TokenRequestError` can be imported from `pdc_api`.
27
+
28
+ ## 0.3.0 (2026-11-18)
29
+
30
+ - The package is now type checked with mypy (including strict mode), pyrefly, and ty, so its `py.typed` marker is accurate. The testing helpers and seeding modules are fully annotated.
31
+ - The minimum versions are now `requests>=2.34`, `urllib3>=2`, and, for the `seeding` extra, `faker>=26`, the first releases that ship type information.
32
+ - `APISession(timeout=...)` accepts a float.
33
+ - `KeycloakAdmin.ensure_organization` raises `LookupError` if Keycloak creates an organization without returning its id.
34
+
35
+ ## 0.2.1 (2026-11-12)
36
+
37
+ - `create_initiative` and `create_initiative_field_value` create an initiative and add a field value to it. `seed_initiative` and `seed_initiative_field_value` now call them.
38
+
39
+ ## 0.2.0 (2026-11-09)
40
+
41
+ - `create_changemaker_source`, `create_changemaker_field_value_batch`, and `create_changemaker_field_value` write a changemaker's own field values.
42
+ - Seeding drops `seed_changemaker_field_value_batch` and `seed_changemaker_field_value`; use the client functions above.
43
+ - `APISession` retries a GET or HEAD up to three times, with backoff, on a 502, 503, or 504 or a dropped connection. Other methods never retry.
44
+ - `SeededProposalBundle.changemaker` may be `None`, for a proposal seeded without a changemaker.
45
+
46
+ ## 0.1.0 (2026-11-09)
47
+
48
+ The first release.
49
+
50
+ - Models generated from the PDC API spec labeled 0.42.0, downloaded 2026-11-06, including the `User` fields `syncedFromKeycloakAt` and `disabledAt`, and `UserSyncTask`.
51
+ - `APISession` with bearer auth, URL building, and one exception class per HTTP error status.
52
+ - `KeycloakClientCredentialsProvider` for service-account access.
53
+ - Read functions for changemakers, funders, data providers, proposals, initiatives, application forms, organizations, field values, and base fields, plus `get_bundle_page` for paginated reads.
54
+ - `get_application_form_by_name` returns the first application form with a given name, and raises `ApplicationFormNotFoundError` when there is none.
55
+ - `session` is positional and every other argument keyword-only, across all functions.
56
+ - Write functions for proposals, proposal versions, changemaker-proposal links, and file uploads.
57
+ - Full create, read, update, and delete support for permission grants and default permission grants.
58
+ - Optional `testing` and `seeding` extras.