semvec/pypi-packages huggingface dataset:
ydapi-sdk 0.1.4
A Python SDK for tracking API requests
Requires Python: >=3.10

# ydapi_sdk

这个sdk用于ydapi平台记录api访问数据，方便用户便捷使用和分析接口的访问情况

## 安装

1. 从[这里](https://github.com/firework-a/ydapi_sdk)下载SDK包 .
2. 使用pip安装软件包:
   ```bash
   pip install ydapi-sdk
   ```

## 集成

### 首先你要从ydapi平台申请一个密钥！

### 示例代码

```python
# 导入 YdSDKClient 类
from ydapi_sdk.client import YdSDKClient

# 初始化 SDK 客户端
api_key = "your_api_key"
client = YdSDKClient(api_key)


# 1. 发送 GET 请求
def send_get_request():
   url = "https://example.com/api/data"
   params = {
      "param1": "value1",
      "param2": "value2"
   }
   headers = {
      "Custom-Header": "Custom-Value"
   }
   try:
      response = client.get(url, params=params, headers=headers)
      print("GET 请求响应:", response)
   except Exception as e:
      print("GET 请求出错:", e)


# 2. 发送 POST 请求
def send_post_request():
   url = "https://example.com/api/create"
   data = {
      "key1": "value1",
      "key2": "value2"
   }
   headers = {
      "Custom-Header": "Custom-Value"
   }
   try:
      response = client.post(url, data=data, headers=headers)
      print("POST 请求响应:", response)
   except Exception as e:
      print("POST 请求出错:", e)


# 3. 发送 PUT 请求
def send_put_request():
   url = "https://example.com/api/update/1"
   json_data = {
      "field1": "new_value1",
      "field2": "new_value2"
   }
   headers = {
      "Custom-Header": "Custom-Value"
   }
   try:
      response = client.put(url, json=json_data, headers=headers)
      print("PUT 请求响应:", response)
   except Exception as e:
      print("PUT 请求出错:", e)


# 4. 发送 DELETE 请求
def send_delete_request():
   url = "https://example.com/api/delete/1"
   headers = {
      "Custom-Header": "Custom-Value"
   }
   try:
      response = client.delete(url, headers=headers)
      print("DELETE 请求响应:", response)
   except Exception as e:
      print("DELETE 请求出错:", e)


# 5. 发送 PATCH 请求
def send_patch_request():
   url = "https://example.com/api/partial-update/1"
   json_data = {
      "field1": "updated_value1"
   }
   headers = {
      "Custom-Header": "Custom-Value"
   }
   try:
      response = client.patch(url, json=json_data, headers=headers)
      print("PATCH 请求响应:", response)
   except Exception as e:
      print("PATCH 请求出错:", e)


# 执行各个请求示例
send_get_request()
send_post_request()
send_put_request()
send_delete_request()
send_patch_request()
```
controlled-vocabulary-utils 0.3.0
A package for evaluating values for terms in a controlled vocabulary.
Requires Python: >=3.10
Keywords: controlled_vocabulary_utils

===========================
Controlled Vocabulary Utils
===========================

A package for evaluating values for terms in a controlled vocabulary.

Usage
-----


Contents of the controlled vocabulary configuration file:

.. code-block:: yaml

    ---
    format_version: 0.1.0
    name: Controlled Vocabulary for Bioinformatics
    description: TBD
    terms:
      - name: variant_effect_on_function
        def: The effect that the variant has on the function of the gene.
        datatype: string
        accepted_values:
          "loss": The variant has caused a loss of function.
          "gain": The variant has caused a gain of function.
      - name: region_of_transcript_affected
        def: The region of the transcript that the variant affects.
        datatype: string
        accepted_values:
          "start": The variant affects the start of the transcript.
          "end": The variant affects the end of the transcript.
          "whole transcript": The variant affects the whole transcript.
          "overlapping end": The variant overlaps one end of the ends of the transcript.
      - name: variant_status
        def: TBD
        alt_names:
          - variant_qc_status
        datatype: string
        accepted_values:
      - name: score
        def: TBD
        datatype: integer
        accepted_values:
          "10": "very low score"
          "20": "low score"
          "40": "mid-level score"
      - name: zygosity
        def: TBD
        alt_names:
          - zyg
        datatype: string
        accepted_values:
          "heterozygous": "heterozygous"
          "homozygous": "homozygous"
          "mosaic": "mosaic"



.. code-block:: python

    from controlled_vocabulary_utils import CVValidationManager

    config_file = "conf/controlled_vocabulary.yaml"

    vm = ValidationManager(
        config_file=config_file,
        verbose=verbose,
    )

    term = "zygosity"
    val = "mosaic"
    if vm.is_valid(term, val):
        print(f"'{val}' is a valid value for term '{term}'")
    else:
        print(f"'{val}' is NOT a valid value for term '{term}'")


=======
History
=======

0.1.0 (2025-02-22)
------------------

* First release on PyPI.
datetimecoords 0.1.0
A package to provide tools to handle computations with datetime-like data.

# Datetime Coordinates

---

This python package implements a feature allowing easy coding of datetime-like data without the
annoyances of handling datetime-like data. Assim

It provides:

* high level function decorator `datetime_coords`
* lower level class `DateTimeCoord` for building other more customized decorators.
* a marker `DatetimeLike` to indicate which data should be seen as datetime-like.

---

## Installation

Within your python enviroment type

> `pip install dtcoords`

## Usage

This simplest way of using it is applying directly the decorator into a function wherein datetime-like data is
been processed.

There is only a short protocol to be followed:

*  datetime-like parameters must be argument in a function (whether positional or keyword) and be typehinted with the special marker `DatetimeLike` provided by the package.

* function must be defined as generic dictionary kws arguments or the special reserved keys: `_unit`; `_ref` or both.
  * valid units for `_unit` parameter are the ones supported by numpy datetime dtype ([numpy datetime units](https://numpy.org/doc/stable/reference/arrays.datetime.html#datetime-units))
  * `_ref` should be datetime-like and represents the "zeroth" location on the coordinates to which the data is been referenced under the hood.

* As of now, nesting `Datetimelike` in `Sequence` or similar, won't do no good.

## Quickstart

Let's have a basic function computing velocity as an average speed. The function should
implement the following reasoning:

> $$ v_{avg} = (x_2 - x_1) / (t_2 - t_1) $$

Start off by importing *basic objects*

```
from dtcoords import datetime_coords, DatetimeLike
```

They are meant to be used together.

```
@datetime_coords
def compute_average_seed(t1: DatetimeLike, x1: float, t2: DatetimeLike, x2: float, **kwargs) -> float:
    delta_x = x2 - x1
    delta t = t2 - t1
    return delta_x / delta_t
```

Note that `t1` and `t2` are supposed to be datetime-like as a pandas Timestamp or the builtin python datetime,
nonetheless within the code they can be regarded as just common numeric data. Thus the code becomes more aligned
with how human brain thinks regarding time as quantity. So, regular operations are readily used and the return number is an ordinary `float`.

The function could then be called within a script as

```
import datetime
t1 = datetime.datetime(...)
t2 = datetime.datetime(...)
x1: float = ...
x2: float = ...
```

if x's are given in meters (for instance), then we are determinig our average speed in meters per seconds by requiring computation to be run with time unit in seconds `s`.

```
avg_speed = compute_average_speed(t1, x1, t2, x2, _unit='s')
```

---

**autor: Conrado**