semvec/pypi-packages huggingface dataset:
brickse 0.2.0
Python access to BrickSet API.
License: MIT

# Brickse

The *brickse* library provides a collection of utilities to retrieve various data from
[BrickSet.com](https://brickset.com/) bricks repository. It can be used either as a simple tool, which reads
requested data and converts them into easy-access custom classes or by using the API directly to allow handling the
HTTPResponse in whatever way you want.

Please see the *examples* folder or in-code documentation of classes and functions to learn more about the *brickse*
library capabilities as well as the original documentation of the
[BrickSet API](https://brickset.com/article/52664/api-version-3-documentation).

See also a similar tool for [Rebrickable.com](https://rebrickable.com/) called [rebrick](https://github.com/xxao/rebrick).


## Tool Example

```python
import brickse

# init Brickse tool
bs = brickse.Brickse("your_API_KEY_here", "your_USER_TOKEN_here", silent=True)

# get set info
data = bs.get_set(set_number=6608)
print(data)

# if user token is not provided on init you can get it later to access user data
bs.login("your_username_here", "your_password_here")

# get user sets
data = bs.get_users_sets(owned=True)
print(data)
```

## API Example

```python
import brickse
import json

# init brickse module for general reading
brickse.init("your_API_KEY_here")

# get set info
response = brickse.lego.get_set(set_number=6608)
print(json.loads(response.read()))

# init brickse module including user reading
brickse.init("your_API_KEY_here", "your_USER_TOKEN_here")

# if you don't know the user token you can use your login credentials
brickse.init("your_API_KEY_here", "your_username_here", "your_password_here")

# get user sets
response = brickse.users.get_sets(owned=True)
print(json.loads(response.read()))
```

## Installation

The *brickse* library is fully implemented in Python. No additional compiler is necessary. After downloading the source
code just run the following command from the *brickse* folder:

```$ python setup.py install```

or simply by using pip

```$ pip install brickse```


## Disclaimer

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
rebrick 0.4.0
Python access to Rebrickable API.
License: MIT

# Rebrick

The *rebrick* library provides a collection of utilities to retrieve various data from
[Rebrickable.com](https://rebrickable.com/) bricks repository. It can be used either as a simple tool, which reads
requested data and converts them into easy-access custom classes or by using the API directly to allow handling the
HTTPResponse in whatever way you want.

Please see the *examples* folder or in-code documentation of classes and functions to learn more about the *rebrick*
library capabilities as well as the original documentation of the
[Rebrickable API](https://rebrickable.com/api/v3/docs/).

See also a similar tool for [BrickSet.com](https://brickset.com/) called [brickse](https://github.com/xxao/brickse).


## Tool Example

```python
import rebrick

# init Rebrick tool
rb = rebrick.Rebrick("your_API_KEY_here", "your_USER_TOKEN_here", silent=True)

# get set info
data = rb.get_set(6608)
print(data)

# if user token is not provided on init you can get it later to access user data
rb.login("your_username_here", "your_password_here")

# get user partlists
data = rb.get_users_partlists()
print(data)
```

## API Example

```python
import rebrick
import json

# init rebrick module for general reading
rebrick.init("your_API_KEY_here")

# get set info
response = rebrick.lego.get_set(6608)
print(json.loads(response.read()))

# init rebrick module including user reading
rebrick.init("your_API_KEY_here", "your_USER_TOKEN_here")

# if you don't know the user token you can use your login credentials
rebrick.init("your_API_KEY_here", "your_username_here", "your_password_here")

# get user partlists
response = rebrick.users.get_partlists()
print(json.loads(response.read()))
```

## Installation

The *rebrick* library is fully implemented in Python. No additional compiler is necessary. After downloading the source
code just run the following command from the *rebrick* folder:

```$ python setup.py install```

or simply by using pip

```$ pip install rebrick```


## Disclaimer

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
pfehler 0.10
Captures and logs exceptions, optionally printing them to stderr
License: MIT
Keywords: log,exceptions


# Captures and logs exceptions, optionally printing them to stderr.

## Tested against Windows 10 / Python 3.10 / Anaconda

## pip install pfehler

```python
Capture and log exceptions, optionally printing them to stderr.

Args:
	logfile (str, optional): The path to the error log file where the exception details
		will be appended. If not provided, no logging to a file will occur.
	print_error (bool, optional): If True, the exception details will be printed to stderr.
		If False, no output will be printed. Defaults to True.

Example:
	from pfehler import pfehler
	try:
		x = 5 / 0
	except Exception:
		pfehler(logfile="c:\\errorlogfile.txt", print_error=True)

This function captures an exception's traceback, optionally prints it to stderr, and
appends the error details along with a timestamp to a specified log file. If the log file
does not exist, it will be created. The timestamp format is "YYYY_MM_DD_HH_MM_SS_microseconds".
```
stderrstdoutcapture 0.10
captures temporarily stdout and stderr
License: MIT
Keywords: capture,stdout,stderr


# captures temporarily stdout and stderr

## Tested against Windows 10 / Python 3.10 / Anaconda

## pip install stderrstdoutcapture

### GetStdErr

```python
A context manager that captures and temporarily redirects standard error (stderr) to a list.

Usage:
	from stderrstdoutcapture import GetStdErr

	def errtest():
	try:
		x = 5 / 0
	except Exception:
		return "error"

	with GetStdErr() as o2:
		returnvalue2 = errtest()
	print(o2)  # Access captured stderr as a list
	print(f"{returnvalue2=}")  # Display the return value of the function

Methods:
	__enter__(*args, **kwargs): Enter the context and redirect stderr to a StringIO buffer.
	__exit__(*args, **kwargs): Exit the context and append the captured stderr to the list.

```

### GetStdOut


```python
A context manager that captures and temporarily redirects standard output (stdout) to a list.

Usage:
	from stderrstdoutcapture import GetStdOut
	def outtest():
		try:
			x = 5 / 5
			print("five devided by five is one")
			return x
		except Exception:
			pass

	with GetStdOut() as o1:
		returnvalue1 = outtest()
	print(o1)  # Access captured stdout as a list
	print(f"{returnvalue1=}")  # Display the return value of the function

Methods:
	__enter__(*args, **kwargs): Enter the context and redirect stdout to a StringIO buffer.
	__exit__(*args, **kwargs): Exit the context and append the captured stdout to the list.
```