Package Search Help

You can use boolean logic (e.g. AND/OR/NOT) for complex search queries. For more help and examples, see the search documentation.

Search by package name:
my-package (implicit)
name:my-package (explicit)

Search by package filename:
filename:my-package.ext 

Search by package tag:
tag:latest 

Search by package version:
version:1.0.0  prerelease:true (prereleases)
prerelease:false (no prereleases)

Search by package architecture:
architecture:x86_64 

Search by package distribution:
distribution:el 

Search by package license:
license:MIT 

Search by package format:
format:deb 

Search by package status:
status:in_progress 

Search by package file checksum:
checksum:5afba 

Search by package security status:
severity:critical 

Search by package vulnerabilities:
vulnerabilities:>1 
vulnerabilities:<1000 

Search by # of package downloads:
downloads:>8 
downloads:<100 

Search by package type:
type:binary 
type:source 

Search by package size (bytes):
size:>50000 
size:<10000 

Search by dependency name/version:
dependency:log4j 
dependency:log4j=1.0.0 
dependency:log4j>1.0.0 

Search by uploaded date:
uploaded:>"1 day ago" 
uploaded:<"August 14, 2022 EST" 

Search by entitlement token (identifier):
entitlement:3lKPVJPosCsY 

Search by policy violation:
policy_violated:true
deny_policy_violated:true
license_policy_violated:true
vulnerability_policy_violated:true

Search by repository:
repository:repo-name

Search by last download date:
last_downloaded:<"30 days ago" 
last_downloaded:>"August 14, 2022 EST" 

Search queries for all Debian-specific (and related) package types

Search by component:
deb_component:unstable

Search queries for all Maven-specific (and related) package types

Search by group ID:
maven_group_id:org.apache

Search queries for all Docker-specific (and related) package types

Search by image digest:
docker_image_digest:sha256:7c5..6d4
(full hashref only)

Search by layer digest:
docker_layer_digest:sha256:4c4..ae4
(full hashref only)

Search queries for all Generic-specific package types

Search by file path:
generic_filepath:path/to/file.txt

Search by directory:
generic_directory:path/to

Field type modifiers (depending on the type, you can influence behaviour)

For all queries, you can use:
~foo for negation

For string queries, you can use:
^foo to anchor to start of term
foo$ to anchor to end of term
foo*bar for fuzzy matching

For number/date or version queries, you can use:
>foo for values greater than
>=foo for values greater / equal
<foo for values less than
<=foo for values less / equal

Need a secure and centralised artifact repository to deliver Alpine, Cargo, CocoaPods, Composer, Conan, Conda, CRAN, Dart, Debian, Docker, Generic, Go, Helm, Hex, HuggingFace, LuaRocks, Maven, npm, NuGet, P2, Python, RedHat, Ruby, Swift, Terraform, Vagrant, VSX, Raw & More packages?

Cloudsmith is the new standard in Package / Artifact Management and Software Distribution.

With support for all major package formats, you can trust us to manage your software supply chain.

Start My Free Trial

Python logo bw-simapro-csv  0.1.4

One-liner (summary)

Utility library to read and parse SimaPro CSV LCI and LCIA files

Description

# bw_simapro_csv

[![PyPI](https://img.shields.io/pypi/v/bw_simapro_csv.svg)][pypi status] [![Status](https://img.shields.io/pypi/status/bw_simapro_csv.svg)][pypi status] [![Python Version](https://img.shields.io/pypi/pyversions/bw_simapro_csv)][pypi status] [![License](https://img.shields.io/pypi/l/bw_simapro_csv)][license]

[![Read the documentation at https://bw_simapro_csv.readthedocs.io/](https://img.shields.io/readthedocs/bw_simapro_csv/latest.svg?label=Read%20the%20Docs)][read the docs] [![Tests](https://github.com/brightway-lca/bw_simapro_csv/actions/workflows/python-test.yml/badge.svg)][tests] [![Codecov](https://codecov.io/gh/brightway-lca/bw_simapro_csv/branch/main/graph/badge.svg)][codecov]

[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)][pre-commit] [![Black](https://img.shields.io/badge/code%20style-black-000000.svg)][black]

[pypi status]: https://pypi.org/project/bw_simapro_csv/ [read the docs]: https://bw_simapro_csv.readthedocs.io/ [tests]: https://github.com/brightway-lca/bw_simapro_csv/actions?workflow=Tests [codecov]: https://app.codecov.io/gh/brightway-lca/bw_simapro_csv [pre-commit]: https://github.com/pre-commit/pre-commit [black]: https://github.com/psf/black

## Installation

You can install _bw_simapro_csv_ via from [PyPI](https://pypi.org/project/bw-simapro-csv/):

`console $ pip install bw_simapro_csv `

Or using conda/mamba from the channel cmutel:

`console $ mamba install -c conda-forge -c cmutel bw_simapro_csv `

To install with the compatible Brightway libraries via pip:

`console $ pip install "bw_simapro_csv[brightway]"" `

Or via conda/mamba:

`console $ mamba install -c conda-forge -c cmutel bw_simapro_csv brightway25 `

On MacOS with ARM chips, run instead:

`console $ mamba install -c conda-forge -c cmutel bw_simapro_csv brightway25_nosolver `

See the Brightway docs for more on [ARM CPUs and sparse solvers](https://docs.brightway.dev/en/latest/content/installation/index.html#installing-brightway-using-pip).

## Usage

bw_simapro_csv extracts a single SimaPro separated value export file to a series of blocks. Files can be CSV, TSV, or some other separator. Basic usage:

`python from pathlib import Path from bw_simapro_csv import SimaProCSV sp = SimaProCSV(Path("my SimaPro file.csv")) `

The file object must be an instance of pathlib.Path or io.StringIO. The SimaProCSV will do the following:

  • Determine the file type. There are three kinds of SimaPro export files: "processes", "methods", and "product stages". This library does not yet work with product stages.
  • Read the header, and build SimaProCSV.header. The header is a dictionary of metadata. We do our best to convert the values to their python equivalents, such as datetimes or booleans.
  • Using the metadata, read the rest of the file, and convert it into a series of blocks. Each block has its own data schema, though they are mostly similar.
  • While reading the file, some common data mistakes are cleaned up. For example, impossible uncertainty distributions are switch to UnkownUncertainty. We also do our best to create valid and reasonable unicode text.
  • Many numeric values can be defined by formulae. In order to parse these formulae in python, we need to substitute some operators for their python equivalents (e.g. ** instead of ^). As python is case-sensitive, we switch all variable names to upper case, and add the prefix SP_, so my_variable would become SP_MY_VARIABLE. We then evaluate all formulas (including for allocation), and store their numeric results in the amount field.

The end result is SimaProCSV.blocks, a list of SimaProCSVBlock instances with parsed and cleaned data.

## Products versus processes

Despite the presence of a Products block in processes, SimaPro doesn't really differentiate between between the two. Therefore, all process datasets should be considered as [ProcessWithReferenceProduct](https://github.com/brightway-lca/bw_interface_schemas/blob/5fb1d40587aec2a4bb2248505550fc883a91c355/bw_interface_schemas/lci.py#L83). Consider this quote from the tutorial:

Process name in SimaPro Under the Documentation tab, you can enter the process name. Please note that this is only for your own reference and this name is not used anywhere. Processes are identified by the name defined under the Input/Output tab in the product section. Therefore, if you want to search for a certain process, you should use the product name defined in the Input/Output as the keyword.

## Waste modelling

The intersection of ecoinvent waste models (negative values means things labelled as inputs are outputs, and vice-versa) and SimaPro Waste treatment versus Waste to treatment make life interesting. The SimaPro model is:

  • Waste treatment are inputs, and indicate that the given process is a waste treatment process, i.e. it does not have a Products block, and has the category_type waste treatment.
  • Waste to treatment are outputs, and indicate that waste is being produced which needs to be treated. Negative amounts in Waste to treatment indicate that these wastes are inputs, and that this process is a waste treatment process.

We label edges in both Products and Waste treatment as functional when exporting to Brightway.

## Logging

bw_simapro_csv uses the [loguru](https://github.com/Delgan/loguru) library for controlling logs. By default, logs are printed to stderr, and two log files are created: warning.log for important errors or information messages, and debug.log, for a detailed log of operations and resolved data issues.

Log are created in a directory path drawn from the [platformdirs](https://platformdirs.readthedocs.io/en/latest/) library; you can copy them to a more convenient place with SimaProCSV.copy_log_dir(some_dir), where some_dir is a pathlib.Path directory instance.

## Exporting to Brightway

Process datasets can be exported to a format usable by bw2io with SimaProCSV.to_brightway(). This returns a Python dictionary, but you can also write this data to a file on disk by passing a pathlib.Path instance, i.e.:

`python from pathlib import Path from bw_simapro_csv import SimaProCSV sp = SimaProCSV(Path("my SimaPro file.csv")) sp.to_brightway(Path("my-export.json")) `

## Blocks

## Contributing

Contributions are very welcome. To learn more, see the [Contributor Guide][Contributor Guide].

## License

Distributed under the terms of the [MIT license][License], _bw_simapro_csv_ is free and open source software.

## Issues

If you encounter any problems, please [file an issue][Issue Tracker] along with a detailed description.

<!-- github-only -->

[command-line reference]: https://bw_simapro_csv.readthedocs.io/en/latest/usage.html [License]: https://github.com/brightway-lca/bw_simapro_csv/blob/main/LICENSE [Contributor Guide]: https://github.com/brightway-lca/bw_simapro_csv/blob/main/CONTRIBUTING.md [Issue Tracker]: https://github.com/brightway-lca/bw_simapro_csv/issues

Size

35.7 KB

Downloads

5

Status  Completed
Checksum (MD5) 71c73ac48ee4c1884fb3fc6fd9698fe3
Checksum (SHA-1) 743c1bfe7182aa47245b99cf073a9bbc1e65e8d4
Checksum (SHA-256) 99fb9a638732c71e9dee174c8b40500b159786f1fb93b47f39828e619b8eb133
Checksum (SHA-512) d668f2f644eb9aa5a51250eb1ed2daf05fce219011640c2548472b0ca123ff98d8…
GPG Signature
GPG Fingerprint 6811684bac0b8895434e97bdd4391b8fb999e537
Storage Region  Dublin, Ireland
Type  Binary (contains binaries and binary artifacts)
Uploaded At 4 months, 3 weeks ago
Uploaded By Fetched by Cloudsmith
Slug Id bw_simapro_csv-014-py3-none-anywhl-4i5c
Unique Id FbR04dOpsLjMECpl
Version (Raw) 0.1.4
Version (Parsed)
  • Major: 0
  • Minor: 1
  • Patch: 4
  • Type: SemVer (Compat)
  extended metadata
Author bw_simapro_csv <cmutel@gmail.com>
Classifiers Development Status :: 4 - Beta | Natural Language :: English | Operating System :: OS Independent | Programming Language :: Python | Programming Language :: Python :: 3 | Programming Language :: Python :: 3.10 | Programming Language :: Python :: 3.11 | Programming Language :: Python :: 3.12 | Topic :: Scientific/Engineering
Maintainer bw_simapro_csv <cmutel@gmail.com>
Metadata Version 2.1
Project Urls homepage, https://github.com/brightway-lca/bw_simapro_csv | source, https://github.com/brightway-lca/bw_simapro_csv | tracker, https://github.com/brightway-lca/bw_simapro_csv/issues
Py Filetype bdist_wheel
Py Version py3
Requires Dist black ; extra == 'dev' | build ; extra == 'dev' | bw-simapro-csv ; extra == 'testing' | bw2data >=4.0.dev42 ; extra == 'brightway' | bw2io >=0.9.dev27 ; extra == 'brightway' | bw2parameters | ftfy | isort ; extra == 'dev' | loguru | platformdirs | pre-commit ; extra == 'dev' | pydantic | pylint ; extra == 'dev' | pytest ; extra == 'dev' | pytest ; extra == 'testing' | pytest-cov ; extra == 'dev' | pytest-cov ; extra == 'testing' | pytest-randomly ; extra == 'dev' | pytest-randomly ; extra == 'testing' | python-coveralls ; extra == 'testing' | python-dateutil | setuptools ; extra == 'dev' | stats-arrays
Requires Python >=3.10
pkg bw_simapro_csv-0.1.4-py3-none-a… 5
35.7 KB
md5 sha1 sha256 sha512
Package Contents (bw_simapro_csv-0.1.4-py3-none-any.whl)
Loading...

This package has 38 files/directories.

 Newer Python logo
bw-simapro-csv
 0.3.6
5 Fetched by Cloudsmith
 Newer Python logo
bw-simapro-csv
 0.3.5
5 Fetched by Cloudsmith
 Newer Python logo
bw-simapro-csv
 0.3.3
5 Fetched by Cloudsmith
 Newer Python logo
bw-simapro-csv
 0.3.2
5 Fetched by Cloudsmith
 Newer Python logo
bw-simapro-csv
 0.3.1
5 Fetched by Cloudsmith
 Newer Python logo
bw-simapro-csv
 0.3
5 Fetched by Cloudsmith
 Newer Python logo
bw-simapro-csv
 0.2.6
5 Fetched by Cloudsmith
 Newer Python logo
bw-simapro-csv
 0.2.5
5 Fetched by Cloudsmith
 Newer Python logo
bw-simapro-csv
 0.2.4
5 Fetched by Cloudsmith
 Newer Python logo
bw-simapro-csv
 0.2.3
5 Fetched by Cloudsmith
 Newer Python logo
bw-simapro-csv
 0.2.2
5 Fetched by Cloudsmith
 Newer Python logo
bw-simapro-csv
 0.2.1
6 Fetched by Cloudsmith
 Newer Python logo
bw-simapro-csv
 0.2
5 Fetched by Cloudsmith
 Newer Python logo
bw-simapro-csv
 0.1.9
5 Fetched by Cloudsmith
 Newer Python logo
bw-simapro-csv
 0.1.8
5 Fetched by Cloudsmith
  Python logo
bw-simapro-csv
 0.1.4
5 Fetched by Cloudsmith
 Older Python logo
bw-simapro-csv
 0.1.3
5 Fetched by Cloudsmith
 Older Python logo
bw-simapro-csv
 0.1.2
5 Fetched by Cloudsmith
 Older Python logo
bw-simapro-csv
 0.1.1
5 Fetched by Cloudsmith
 Older Python logo
bw-simapro-csv
 0.0.1
5 Fetched by Cloudsmith

Last scanned

4 months, 3 weeks ago

Scan result

Clean

Vulnerability count

0

Max. severity

Unknown

You can embed a badge in another website that shows this or the latest version of this package.

To embed the badge for this specific package version, use the following:

[![This version of 'bw-simapro-csv' @ Cloudsmith](https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/bw-simapro-csv/0.1.4/a=noarch;xf=bdist_wheel;xn=bw-simapro-csv;xv=py3/?render=true)](https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/bw-simapro-csv/0.1.4/a=noarch;xf=bdist_wheel;xn=bw-simapro-csv;xv=py3/)
|This version of 'bw-simapro-csv' @ Cloudsmith|
.. |This version of 'bw-simapro-csv' @ Cloudsmith| image:: https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/bw-simapro-csv/0.1.4/a=noarch;xf=bdist_wheel;xn=bw-simapro-csv;xv=py3/?render=true
   :target: https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/bw-simapro-csv/0.1.4/a=noarch;xf=bdist_wheel;xn=bw-simapro-csv;xv=py3/
image::https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/bw-simapro-csv/0.1.4/a=noarch;xf=bdist_wheel;xn=bw-simapro-csv;xv=py3/?render=true[link="https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/bw-simapro-csv/0.1.4/a=noarch;xf=bdist_wheel;xn=bw-simapro-csv;xv=py3/",title="This version of 'bw-simapro-csv' @ Cloudsmith"]
<a href="https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/bw-simapro-csv/0.1.4/a=noarch;xf=bdist_wheel;xn=bw-simapro-csv;xv=py3/"><img src="https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/bw-simapro-csv/0.1.4/a=noarch;xf=bdist_wheel;xn=bw-simapro-csv;xv=py3/?render=true" alt="This version of 'bw-simapro-csv' @ Cloudsmith" /></a>

rendered as: This version of 'bw-simapro-csv' @ Cloudsmith

To embed the badge for the latest package version, use the following:

[![Latest version of 'bw-simapro-csv' @ Cloudsmith](https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/bw-simapro-csv/latest/a=noarch;xf=bdist_wheel;xn=bw-simapro-csv;xv=py3/?render=true&show_latest=true)](https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/bw-simapro-csv/latest/a=noarch;xf=bdist_wheel;xn=bw-simapro-csv;xv=py3/)
|Latest version of 'bw-simapro-csv' @ Cloudsmith|
.. |Latest version of 'bw-simapro-csv' @ Cloudsmith| image:: https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/bw-simapro-csv/latest/a=noarch;xf=bdist_wheel;xn=bw-simapro-csv;xv=py3/?render=true&show_latest=true
   :target: https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/bw-simapro-csv/latest/a=noarch;xf=bdist_wheel;xn=bw-simapro-csv;xv=py3/
image::https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/bw-simapro-csv/latest/a=noarch;xf=bdist_wheel;xn=bw-simapro-csv;xv=py3/?render=true&show_latest=true[link="https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/bw-simapro-csv/latest/a=noarch;xf=bdist_wheel;xn=bw-simapro-csv;xv=py3/",title="Latest version of 'bw-simapro-csv' @ Cloudsmith"]
<a href="https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/bw-simapro-csv/latest/a=noarch;xf=bdist_wheel;xn=bw-simapro-csv;xv=py3/"><img src="https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/bw-simapro-csv/latest/a=noarch;xf=bdist_wheel;xn=bw-simapro-csv;xv=py3/?render=true&show_latest=true" alt="Latest version of 'bw-simapro-csv' @ Cloudsmith" /></a>

rendered as: Latest version of 'bw-simapro-csv' @ Cloudsmith

These instructions assume you have setup the repository first (or read it).

To install/use bw-simapro-csv @ version 0.1.4 ...

pip install 'bw-simapro-csv==0.1.4'

You can also install the latest version of this package:

pip install --upgrade 'bw-simapro-csv'

If necessary, you can specify the repository directly:

pip install \
  --index-url=https://dl.cloudsmith.io/public/demo-docs/awesome-repo/python/simple/ \
  bw-simapro-csv==0.1.4

If you've got a project requirements.txt file, you can specify this as a dependency:

--index-url=https://dl.cloudsmith.io/public/demo-docs/awesome-repo/python/simple/
bw-simapro-csv==0.1.4

In addition, you can use this repository as an extra index url. However, please read our documentation on this parameter before using it. For example in a requirements.txt file:

--extra-index-url=https://dl.cloudsmith.io/public/demo-docs/awesome-repo/python/simple/
bw-simapro-csv==0.1.4
Warning: We highly recommend using pip (or similar) rather than installing directly.
Top