civiqhub¶
The objects of a CiviqHub Project, in Python, from a token or a file:
project = civiqhub.connect().project() # the token is read in CIVIQHUB_TOKEN
project = civiqhub.connect(source=civiqhub.MemorySource(rows)).project()
project = civiqhub.load("consultation.json").project()
connect() returns a Client of a
Source: the API (ApiSource), a file
(FileSource) or memory (MemorySource).
What a source gives is a Dataset: a frozen graph of the objects
of the product, Group, Project,
Article (with ArticleVersion,
Paragraph, Placement and
Citation),
Proposal, Amendment,
Revision, Argument,
Actant (with Member and
Agent) and Vote. They share
Listing and Entity, carry the values
of civiqhub.values, and raise the errors of civiqhub.errors.
make_project() gives a synthetic Project, which describes
nobody, to try the SDK without a token.
- civiqhub.__version__¶
Version of the package, in PEP 440 notation.
Exported names¶
These names are imported from civiqhub. Each one links to the module that defines it.
Name |
What it is |
|---|---|
Version of the package, in PEP 440 notation. |
|
Anyone who acts in a Project: a human member or an agent. |
|
What an Actant is. |
|
A software agent that takes part with the same grammar as a member. |
|
A Proposal that amends another Proposal, on one Revision of it. |
|
Where an Amendment stands. |
|
The public API of CiviqHub, read with a personal access token. It only sends GET. |
|
A reasoned stance on a Proposal. Arguments reply to each other as a tree. |
|
An article of a Project: a text in numbered versions, which Proposals belong to. |
|
One numbered version of an article, frozen as it was published. |
|
Raised when the token is missing, malformed, expired or revoked. |
|
A Proposal cited in the text of an article that is not its parent article. |
|
The root of every error of the SDK. |
|
Reads one source at one level of exposure, and keeps what it read. |
|
Open CiviqHub with a personal access token, or with a source of your own. |
|
Everything a source gave at one instant, at one level of exposure, frozen. |
|
A value of an old dataset that the model no longer has, read and marked. |
|
An object of the product: frozen, known by its id, tied to its dataset. |
|
The level of detail that a dataset holds. |
|
Raised when data is asked for at a level of detail the dataset does not hold. |
|
A file written by |
|
A community on CiviqHub. It holds Groups and Projects. |
|
An ordered, immutable sequence of objects, also searched by id. |
|
Reopen a dataset written by |
|
Return a synthetic Project, to try the SDK without a token and without network. |
|
Return the rows of a synthetic Project, at the pseudonymised level. |
|
Return the planted structure of the synthetic Project, to test what finds it. |
|
A human member of a Project, known by a pseudonym. |
|
Rows held in memory: for tests, simulations and the data of another system. |
|
Raised when an analysis is asked for and the engine is not installed. |
|
Raised when what is asked for is not covered by the token, or does not exist. |
|
A numbered division of an article version, made by a heading of level 1 to 4. |
|
How much a Project is used, in counts. |
|
Where a Proposal sits in a version of its parent article: a paragraph and a rank. |
|
The side that an Argument takes. |
|
A Project of a Group: the set of its articles and of their versions. |
|
A statement put to the collective of a Project. |
|
Raised when the API asks to slow down. |
|
One numbered version of a Proposal. Votes are cast on a Revision. |
|
The roles in a Group or a Project, from the lowest to the highest. |
|
Anything that gives rows in the format of a dataset: the API, a file, memory. |
|
Raised when a value is read from an analysis that has none. |
|
Raised when rows break an invariant of the model. |
|
The vote of one Actant on one Revision, from -2 to +2. |
|
The five vote counts of a Revision, from score -2 to score +2. |
|
Where an Actant stands with a Revision. |