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

python -m pip install carbon-property-tables==0.3.3

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.3.tar.gz (17.1 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.3-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: carbon_property_tables-0.3.3.tar.gz
  • Upload date:
  • Size: 17.1 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.3.tar.gz
Algorithm Hash digest
SHA256 5e12e0faf5028a26dfead2e769a4bfd28c56f5b1da057fd53afe93ac294ab5e4
MD5 7cec3cee6f90e840f1150589077f60a9
BLAKE2b-256 f5e9c64dc9f9f2dce1fcc328824e1a75e0536533e951dc2f44f3bde5e6a76412

See more details on using hashes here.

Provenance

The following attestation bundles were made for carbon_property_tables-0.3.3.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.3-py3-none-any.whl.

File metadata

File hashes

Hashes for carbon_property_tables-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 81e10c94dfa5547eef3ba2b60cbef817e07b4c6049cd7e57987e872d01b8cf8b
MD5 3e6d9f097ce30f4fb1e8259a6cb7c3d3
BLAKE2b-256 2236303cf2b11539afe93638898047e915a9be0d6f781fabccde7a756db7c3b3

See more details on using hashes here.

Provenance

The following attestation bundles were made for carbon_property_tables-0.3.3-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

This release

0.3.3 This release

2 files

0.3.2

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