Skip to main content

Carbon Property Tables Python SDK

The SDK requests citation-backed comparison figures rendered by the Carbon Property Tables service. It is a figure and benchmarking interface, not a bulk database-download client or a local copy of the canonical dataset.

Install from TestPyPI

python -m pip install \
  --index-url https://test.pypi.org/simple/ \
  --extra-index-url https://pypi.org/simple/ \
  carbon-property-tables==0.3.2

Make a figure

import carbon_property_tables as cpt

figure = cpt.scatter(
    "specific strength",
    "specific conductivity",
    log_x=True,
    log_y=True,
)

figure.save("conductivity-strength.svg")
figure

The first property is the x-axis and the second is the y-axis. Readable names are accepted, including "specific cond", "tenacity", "tensile strength", and "thermal conductivity". Misspelled or unknown properties fail explicitly instead of being guessed.

The other figure modes use the same interface:

ranked = cpt.ranked("density", "tensile strength", top=10)
trend = cpt.trend("density", "tensile strength")
ashby = cpt.ashby("density", "specific strength")

Run the complete acceptance test

cpt-feature-tour --output-dir cpt-feature-tour-output

The command tests the production release and property endpoints, scatter/ranked/trend/Ashby figures, material filters, a temporary ranked point, the bounded top table, SVG/PNG/PDF exports, citation and BibTeX sidecars, and validation boundaries. It writes inspectable artifacts plus feature-tour-report.json to the selected directory and exits nonzero on any failure.

The equivalent module command is:

python -m carbon_property_tables.feature_tour --output-dir cpt-feature-tour-output

Install locally

python -m pip install -e ./python

The default client uses the live service at https://carbonnanotubes.onrender.com/api/v1. Set CPT_API_URL or pass a URL to CPTClient to target a local or alternate deployment.

Benchmark a temporary result

import carbon_property_tables as cpt
from carbon_property_tables import TemporaryPoint

comparison = cpt.scatter(
    "specific_strength",
    "specific_electrical_conductivity",
    log_x=True,
    log_y=True,
    peer_reviewed=True,
    material_family=["CNT_or_CNT_hybrid", "CNT_metal_composite"],
    top=5,
    top_by="y",
    formats=("svg", "png", "pdf"),
    temporary=TemporaryPoint(
        x=1.8,
        y=12.0,
        label="My CNT fiber",
    ),
)

comparison.save("conductivity-strength.svg")
print(comparison.temporary_point)

Temporary coordinates use the display units printed on the active axes. They are rendered and ranked against the visible representative material set, but are never written to Carbon Property Tables.

In Jupyter, returning figure from a cell displays its SVG directly. save() accepts any format requested through formats and automatically writes matching .citations.txt and .bib files. SVG alone is requested by default to keep routine calls small.

Extract a bounded top table

Exact values can be requested only for the selected top subset, with a hard maximum of ten rows:

for row in comparison.top_table():
    print(row["rank"], row["label"], row["y_value"], row["y_unit"], row["doi"])

comparison.save_top_table("top-five.csv")

top_by="x" or top_by="y" must name a higher-is-better performance axis. Density and dimensions are filter or normalization variables, not optimization targets.

Figure modes

  • scatter compares any two same-record properties.
  • ranked ranks the y property among records that also contain the selected x property.
  • trend plots the selected y property against publication year.
  • ashby enforces logarithmic axes and shows robust material-family regions where enough data exist.

All bounded figure filters supported by the service can be passed as keyword arguments. For example:

figure = cpt.scatter(
    "density",
    "tensile_strength",
    measurement_filter=["diameter::0.000020"],
    gauge_length_min_mm=10,
    year_min=2015,
)

Measurement-range filters use canonical SI units. Axis values and temporary-point inputs use the display units printed on the figure.

Deliberate access boundary

The public SDK does not expose canonical-record pagination, arbitrary record retrieval, full plot-coordinate tables, or a local plotting engine. Exact tabular output is limited to the explicitly requested top subset and capped at ten rows. A rendered vector figure can still be digitized, so this is an access and citation boundary rather than digital-rights management. Publication use requires the automatically supplied original-source and Carbon Property Tables citations.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

carbon_property_tables-0.3.2.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

carbon_property_tables-0.3.2-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file carbon_property_tables-0.3.2.tar.gz.

File metadata

  • Download URL: carbon_property_tables-0.3.2.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for carbon_property_tables-0.3.2.tar.gz
Algorithm Hash digest
SHA256 939daf16b2f1db472d3821fdbdd6eed10bf339f2c6cc54b43d9a19351cde3a48
MD5 fadf06cb1bf73b3386508340354ffe24
BLAKE2b-256 8939bb976c5e53c214853f3f8956ffd3e9d1406381e5a6d03c27d6799208fca3

See more details on using hashes here.

Provenance

The following attestation bundles were made for carbon_property_tables-0.3.2.tar.gz:

Publisher: python-sdk.yml on gs-stanford/CarbonNanotubes

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file carbon_property_tables-0.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for carbon_property_tables-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7e01cd8c6d3619227cede886ab5655fbf26ceb116de092647a1fd0fd3ca1b5ca
MD5 b5735d8d14ff4850fada5bd389953fd6
BLAKE2b-256 2ec592a228a76a1ec2b5427b3cb7d6b3e98e4f6d289441fbc052d979612e3531

See more details on using hashes here.

Provenance

The following attestation bundles were made for carbon_property_tables-0.3.2-py3-none-any.whl:

Publisher: python-sdk.yml on gs-stanford/CarbonNanotubes

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.3.5

2 files

0.3.4

2 files

0.3.3

2 files

This release

0.3.2 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page