semvec/pypi-packages huggingface dataset:
json-coder 0.5.1
Easily deserialize and serialize complex objects to json.
Requires Python: >=3.6

# json-coder: Quickly serialize and deserialize python to json objects

The default library python `json` module supports custom decoders and encoders
allowing for saving and restoring custom objects into json. In comparison to
pickling objects, this is more portable and easier to manually edit.

This library supports the following use-cases:

- Class with json loading and dumping functions
  (define `.json` property or `.to_json()` method for dumping, define
  `.from_json()` constructor or proper init for reading)

- python `dataclass` classes

- custom loading and dumping functions for classes defined elsewhere

Fundamentally classes are assigned an identifier and json objects of the
following structure are created:

```
{
    '__<identifier>__': <object data>
}
```

## Usage examples

Custom class using predefined schema:

```
import json
import json_coder

@json.jsonify("testclass")
class TestClass:
    def __init__(self, a: int):
        self.a = a

    def to_json(self):
        return {"a": self.a}


# Usage
a = json.loads('{"__testclass__": {"a": 10}}')

print(a)
# <__main__.TestClass object at 0x10eb26810>

print(json.dumps(a))
# {"__testclass__": {"a": 10}}
```

Dataclasses do not require any additional methods to work properly.

```
from dataclasses import dataclass
import json
import json_coder

@json_coder.jsonify("testdataclass")
@dataclass
class TestDataClass:
    a: int


a = json.loads('{"__testdataclass__": {"a": 10}}')
print(type(a))  # should now be an object of testdataclass
print(json.dumps(a))
```

Custom dumper and reading functions can also be added to existing classes by
registering manually:

```
import datetime
import json
import json_coder

json_coder.register("datetime", datetime.datetime, datetime.datetime.fromisoformat, datetime.datetime.isoformat)
d = json.loads('{"__datetime__": "2018-10-10"}')
print(d)
print(json.dumps(d))
```
Meghavi 0.0.4
All python packages by Ms. Meghavi Kshatriya
Requires Python: >=3.6

# Meghavi
Meghavi is a python package that contains various classes and functions that you can import and use them in your python programs

### Installation

Meghavi requires Python 3 to run.

Install the package and you are ready to go.

```sh
$ pip install Meghavi
```

To install Meghavi, along with the tools you need to develop and run tests, run the following in your virtualenv:

```sh
$ pip install -e .[dev]
```

### Usage of fetchTextRepo

#### Description
fetchTextRepo is a class that has a function named fetchTextRepo() that returns you the list of data of all the files of a github public repository.

Import the library using the following command.

```sh
import Meghavi
```

Call the method fetchTextRepo(url) and pass the github public repository url  
```sh
Meghavi.fetchTextRepo("https://github.com/userName/repositoryName")
```

License
----

MIT
pubmed2dataset 0.0.1
Utility to retrieve (annotated) text from PubTator
Requires Python: >=3.7

# pubtator2dataset

A Python library that provides interfaces to download annotated articles from PubTator Central.

The primary aim of this library is to offer easy access to text data for text mining or annotation projects. 

For this reason the focus of the interfaces is on the text fields, although metadata might be included in the future.

The interface is decomposed in:

- PubTatorFetcher: makes the request via [Eutils](https://www.ncbi.nlm.nih.gov/books/NBK25500/) and retrieve the (annotated) texts
- PubTatorParser: parse the raw text the generate a structured object
- PubTatorDownloader: combines the previous two

## How to

In order to download the annotated datasets it is possible to:

- pass an iterable containing the document IDs (PubMed ID or PMC ID) or a file where each line contains one ID:

```python

from pubtator2dataset import PubTatorDownloader

ptd = PubTatorDownloader(email = 'your email',
                         db = 'pubmed', 
                         out_format = 'biocxml', 
                         bioconcepts = 'all', 
                         batch_size = 10, 
                         loglevel = 'DEBUG')

pmids = [28483577, 28483579]

for d in ptd.get(source = pmids):
    
    print(d)
```


- write a PubMed query which will collect the relevant IDs

```python

from pubtator2dataset import PubTatorDownloader

ptd = PubTatorDownloader(email = 'your email',
                         db = 'pubmed', 
                         out_format = 'biocxml', 
                         bioconcepts = 'all', 
                         batch_size = 10, 
                         loglevel = 'DEBUG')

query = "MyoD+AND+Tapscott+SJ[au]"

for d in ptd.get(source = query):
    
    print(d)
```

It is left to the user to save the output in the corresponding format, i.e. with BioC or plain text file.