semvec/pypi-packages huggingface dataset:
cbgen 1.0.6
Python wrapper around a BGEN library
License: MIT
Requires Python: <4.0,>=3.9
Keywords: bgen, reader, genetics

# cbgen

Python wrapper around a BGEN library.
([cbgen documentation](https://cbgen.readthedocs.io)).

[BGEN](https://www.well.ox.ac.uk/~gav/bgen_format/) is a file format for
storing large genetic datasets. It supports both unphased genotypes and phased
haplotype data with variable ploidy and number of alleles. It was designed to
provide a compact data representation without sacrificing variant access
performance. This Python package is a wrapper around the [bgen
library](https://github.com/limix/bgen), a low-memory footprint reader that
efficiently reads bgen files. It fully supports the bgen format specifications:
1.2 and 1.3; as well as their optional compressed formats.

## Installation

```bash
pip install cbgen
```

## Usage example

```python
>>> import cbgen
>>>
>>> bgen = cbgen.bgen_file(cbgen.example.get("haplotypes.bgen"))
>>> bgen.create_metafile("haplotypes.bgen.metafile")
>>> mf = cbgen.bgen_metafile("haplotypes.bgen.metafile")
>>> print(mf.npartitions)
1
>>> print(mf.nvariants)
4
>>> print(mf.partition_size)
4
>>> part = mf.read_partition(0)
>>> gt = bgen.read_genotype(part.variants.offset[0])
>>> print(gt.probability)
[[1. 0. 1. 0.]
 [0. 1. 1. 0.]
 [1. 0. 0. 1.]
 [0. 1. 0. 1.]]
>>> mf.close()
>>> bgen.close()
```

## Authors

* [Carl Kadie](https://github.com/CarlKCarlK)
* [Danilo Horta](https://github.com/horta)

## License

This project is licensed under the [MIT License](https://raw.githubusercontent.com/limix/cbgen/main/LICENSE).
pymongo-connector 0.0.5
A python package for connecting with database.
License: MIT
Requires Python: >=3.7

### Description

This code defines a class `mongo_operation` that provides methods for interacting with a MongoDB database. The class allows you to create a MongoDB client, create collections, and insert data in bulk. It supports both single records and lists of records, as well as CSV and Excel file formats.

### How to Use

To use this class as a package on PyPI, you can follow these steps:

1. **Install the Package**:
   ```bash
   pip install pymongo-connector
   ```

2. **Import the Class**:
   ```python
   from pymongo_connector import mongo_crud
   ```

3. **Create an Instance of the Class**:
   ```python
   mongo = mongo_crud.mongo_operation(client_url='mongodb://localhost:27017/', database_name='mydatabase', collection_name='mycollection')
   ```

4. **Use the Methods**:
   ```python
   # Insert a single record
   mongo.insert_record({'name': 'John', 'age': 30})

   # Insert multiple records
   records = [{'name': 'Jane', 'age': 25}, {'name': 'Bob', 'age': 40}]
   mongo.insert_record(records)

   # Bulk insert data from a CSV file
   mongo.bulk_insert('data.csv')

   # Bulk insert data from an Excel file
   mongo.bulk_insert('data.xlsx')
   ```