yasuo


Nameyasuo JSON
Version 3.0.0 PyPI version JSON
download
home_pagehttps://github.com/puffer-python/yasuo
SummaryA Yasuo Python package
upload_time2023-05-11 09:26:43
maintainer
docs_urlNone
authorDung BV
requires_python
licenseMIT License
keywords yasuo python vietnamese
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Yasuo Package

[![PyPI](https://img.shields.io/pypi/v/yasuo.svg)](https://pypi.org/project/yasuo/)
[![Build Status](https://img.shields.io/badge/build-passed-brightgreen)](https://github.com/puffer-python/yasuo/actions)
[![GitHub issues](https://img.shields.io/github/issues/puffer-python/yasuo)](https://github.com/puffer-python/yasuo/issues)

Yasuo Package is a Python package that provides functionality related to the popular game League of Legends.
Specifically, it provides tools for analyzing data related to the champion Yasuo.

## Installation

You can install Yasuo Package using pip:

```commandline
pip install yasuo
```

## Usage

After installation, you can import Yasuo Package in your Python script as follows:

```python

import yasuo

```

## List of Functions

### Convert any to an integer

This code snippet provides a function convert_int_field() that can be used to convert any data type to an integer. If
the value cannot be converted, an exception is raised. This function takes in several parameters to customize the
conversion process, such as a default value to return if conversion fails and a minimum value for the resulting integer.

Here's an example usage of convert_int_field():

```
>> convert_int_field(10)
10

>> convert_int_field("10")
10

>> convert_int_field("10a", ignore_error=False, error_message="Input must be a valid integer.")
ValueError: Input must be a valid integer.

```

### Vietnamese Text Converter

This package provides a function to convert Vietnamese text with diacritics to Vietnamese text without diacritics.

```python
from yasuo import convert

text_with_diacritics = "Đây là một ví dụ về tiếng Việt có dấu"
text_without_diacritics = convert(text_with_diacritics)
print(text_without_diacritics)  # Output: "Day la mot vi du ve tieng Viet co dau"

```

### Normalized

The `normalized()` function converts a string to lowercase, removes all diacritics (accents) and extra spaces. This
function can be used to normalize user input or database entries for comparison purposes.

```python
input_string = "Trường Đại học Bách Khoa Hà Nội"
normalized_string = normalized(input_string)
print(normalized_string)  # Output: "truong dai hoc bach khoa ha noi"

```

### Keep Single Spaces

This function keeps only single spaces between words in a string and removes any leading/trailing spaces.

- Inputs:
    - `s_string`: A string
- Outputs
    - A new string with only single spaces between words and no leading/trailing spaces.

Example

```python
keep_single_spaces("  This   is   a   test  ")
'This is a test'

```

### Chunks

The `create_chunks()` function takes in two parameters: `src` and `step`.

`src` is the source string or list that needs to be divided into chunks.

`step` is the maximum length of each chunk.

The function creates a list of chunks by iterating over the `src` string or list and appending slices of length step to
a new list res.

The resulting list res contains all the chunks of length `step` that make up the original `src` string or list.

Example:

```python
src = 'abcdefghijklmnopqrstuvwxyz'
step = 5
chunks = create_chunks(src, step)
print(chunks)
```

Output:

```python
[
    'abcde',
    'fghij',
    'klmno',
    'pqrst',
    'uvwxy',
    'z'
]
```

### Recursively converts byte strings in a dictionary to Unicode strings.

The function reformat_dict recursively decodes byte-encoded dictionary keys and values to utf-8 strings.

Parameters:

- data: a dictionary that may contain byte-encoded keys or values

Return:

- A new dictionary with all byte-encoded keys and values decoded to utf-8 strings

Example

```python
data = {'name': b'John', 'age': 30, 'contacts': {'email': b'john@gmail.com', 'phone': b'123456789'}}
new_data = reformat_dict(data)
print(new_data)
```

Output

```python
{
    'name': 'John',
    'age': 30,
    'contacts': {
        'email': 'john@gmail.com',
        'phone': '123456789'
    }
}



```

### List Duplicates

This function checks if a list has duplicate elements. It returns True if there are duplicates, otherwise False.

Here is an example usage:

```python
>> list_has_duplicates([1, 2, 3, 4, 5])
False

>> list_has_duplicates([1, 2, 3, 3, 4, 5])
True

```

### Remove duplicated

This function removes duplicates from a given list using a Python dictionary. It converts the list to a dictionary where
the elements of the list become the keys of the dictionary, then converts the dictionary back into a list. This process
eliminates any duplicate keys and returns a list with unique elements in the original order.

Example:

```python
a_list = [1, 2, 3, 1, 4, 2, 5, 6, 5]
remove_duplicate_from_list(a_list)
[1, 2, 3, 4, 5, 6]

```

### Is Json

The `is_json` function checks whether the input string is a valid JSON or not.

`str_input`: a string to be checked. If the string is a valid JSON, the function returns True. Otherwise, it returns
False.

Here is an example usage:

```python
input_str = '{"name": "John", "age": 30, "city": "New York"}'
result = is_json(input_str)
print(result)  # True

invalid_str = 'this is not a valid JSON'
result = is_json(invalid_str)
print(result)  # False
```

### Random String

This function generates a random string of a specified length, consisting of both letters (upper and lower case) and
digits.

- `length`: An optional integer argument that specifies the length of the generated string. The default length is 6.-

The function uses the `string` and `random` modules to generate a string with a combination of upper and lower case
letters and digits. It then uses a join function to `join` these characters together to form the random string.

Example usage:

```python

random_string()  # Output: 'tDy8Vc'
random_string(10)  # Output: 'JnZ8WbKu3P'

```

### Camel Case

The camel_case function takes an input string with underscore-separated words and converts it to camel case format.

For example, if the input string is `"hello_world"`, the output will be `"helloWorld"`.

The function takes one parameter:

- `s_string`: the input string to be converted The function returns a string in camel case format. If the input string
  is empty or not a string, the function returns None.

Example

```python
>> camel_case('hello_world')
'helloWorld'
>> camel_case('hello_big_world')
'helloBigWorld'
>> camel_case('hello')
'hello'
>> camel_case('hElLo')
'hello'

```

### Generate URL Key

The `generate_url_key` function takes an input string and returns a URL-safe version of the string, suitable for use as
a URL key.

The function first converts the input string to a normalized format, then removes any characters that are not letters,
numbers, or hyphens. The resulting string is then returned.

The function takes one parameter:

- `a_string`: the input string to be converted The function returns a string in URL-safe format. If the input string is
  empty or not a string, the function returns None.

Example

```python
generate_url_key('Hello, world!')
'hello-world'
generate_url_key('Python is awesome')
'python-is-awesome'
generate_url_key('My favorite number is 42')
'my-favorite-number-is-42'
generate_url_key('')
None

```

### Flatten List

The `flatten_list` function takes a two-dimensional list as input and flattens it into a one-dimensional list.

For example, if the input list is `[[1, 2], [3, 4], [5, 6]]`, the output will be `[1, 2, 3, 4, 5, 6]`.

The function takes one parameter:

- `a_list`: the input two-dimensional list to be flattened The function returns a one-dimensional list. If the input is
  not a two-dimensional list, the function returns None.

Example:

```commandline
>> flatten_list([[1, 2], [3, 4], [5, 6]])
[1, 2, 3, 4, 5, 6]
>> flatten_list([[1, 2, 3], [4], [5, 6]])
[1, 2, 3, 4, 5, 6]
>> flatten_list([[1, 2], [3, 4], 5, 6])
None

```

### Get UTC

The `get_utc_time` function retrieves the current UTC time given a local time zone name. It uses the pytz library to
convert the local time zone to UTC. The function takes two parameters:

- `local_name`: a string representing the name of the local time zone.
- `fmt` (optional): a string representing the format of the returned UTC time.

If not provided, the function returns a datetime object in the UTC time zone. If the local time zone name is not found,
the function raises a ValueError.

Example:

```commandline
>> get_utc_time('US/Eastern', '%Y-%m-%d %H:%M:%S')
'2022-03-07 02:30:26'
>> get_utc_time('Europe/London')
datetime.datetime(2022, 3, 7, 7, 30, 26, 518046, tzinfo=<UTC>)

```

### Dict Diff

The `dict_diff` function takes in two dictionaries, `old_dict` and `new_dict`, and returns a list of differences between
them in the format of `{"key1":{"old":"old_value_key1", "new":"new_value_key1"}}`. If the value of a key is different
between the two dictionaries, it will be included in the result list.

Here's an example:

```python
old_dict = {'key1': 'value1', 'key2': 'value2', 'key3': 'value3'}
new_dict = {'key1': 'value1', 'key2': 'new_value2', 'key4': 'value4'}
diff_list = dict_diff(old_dict, new_dict)
print(diff_list)

```

Output

```commandline
[{'key2': {'old': 'value2', 'new': 'new_value2'}}, {'key3': {'old': 'value3', 'new': None}}, {'key4': {'old': None, 'new': 'value4'}}]

```

### Decapitalize

The `decapitalize` function takes a string input and returns the string with the first character in lowercase and all
other characters unchanged.

For example, if the input string is `"Decapitalize string"`, the output will be `"decapitalize string"`.

The function takes one parameter:

- `a_string`: the input string to be decapitalized

The function returns a string with the first character in lowercase and all other characters unchanged. If the input
string is empty or not a string, the function returns None.

Example:

```python
>> decapitalize("Decapitalize string")
'decapitalize string'
>> decapitalize("capitalize")
'capitalize'
>> decapitalize("")
''

```

### Safe Cast

The `safe_cast` function is used to convert a value of any type to a specified type. If the conversion fails, it returns
a default value instead of raising an exception.

The function takes three parameters:

- `val`: the value to be converted
- `to_type`: the type to which val should be converted
- `default` (optional): the default value to be returned if the conversion fails. If default is not specified, None is
  returned.

The function first tries to convert `val` to `to_type` using the built-in conversion function for that type. If the
conversion fails, it tries to convert `val` to boolean if `to_type` is `bool`. If the conversion succeeds, it returns
the converted value; otherwise, it returns the default value.

Example:

```python
>> safe_cast("10", int, 0)
10

>> safe_cast("10.5", float, 0.0)
10.5

>> safe_cast("True", bool, False)
True

>> safe_cast("invalid", int, 0)
0

>> safe_cast(None, int, 0)
0

>> safe_cast(None, int)
None

```

### Cast Separated String

The `cast_separated_string_to_ints` function takes a string containing integers separated by a specified separator and
returns a list of integers.

The function takes two parameters:

- `separated_str`: a string containing integers separated by a specified separator
- `sep`: the separator used in the input string (default value is ,)

The function returns a list of integers extracted from the input string, ignoring any non-numeric values. If the input
string is empty, the function returns an empty list.

Example:

```python
>> cast_separated_string_to_ints('1,2,3,4')
[1, 2, 3, 4]
>> cast_separated_string_to_ints('1-2-3-4', '-')
[1, 2, 3, 4]
>> cast_separated_string_to_ints('1,abc,3,def')
[1, 3]
>> cast_separated_string_to_ints('')
[]

```

### HTML Converter

The `convert_to_html_tag` function replaces all newline characters in the input string with an HTML line break
tag (`<br>`), effectively converting the string to a format suitable for display in HTML.

Function parameters:

- `s_string` : The input string to be converted.

Function return value:

- The function returns a string with newline characters replaced by the HTML line break tag.

### Fibonacci

This function calculates the value of the nth number in the Fibonacci sequence. The Fibonacci sequence is a series of
numbers in which each number is the sum of the two preceding numbers, starting from 0 and 1. For example, the first few
numbers in the sequence are 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ...

The number parameter is the position of the desired Fibonacci value (starting from 0). For instance, if number is 5, the
function returns the 5th number in the Fibonacci sequence, which is 5. If number is less than or equal to 1, the
function simply returns number.

The function uses recursion to calculate the Fibonacci value. Specifically, it calls itself with number - 1 and number -
2 as arguments and returns the sum of the two resulting values.

Example

```python

# Calculate the first 10 numbers in the Fibonacci sequence
for i in range(10):
    print(fibonacci(i))
# Output: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34

```

# License

This code is released under the MIT License.

You can copy and paste the code into your Python project and modify it as needed. If you have any questions or issues,
please don't hesitate to reach out.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/puffer-python/yasuo",
    "name": "yasuo",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "yasuo,python,vietnamese",
    "author": "Dung BV",
    "author_email": "bvdzung@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/be/ee/024aca15afa111dc0c9ec3b91e2b2f9d796eb645cfa768c6ec9e467bb12c/yasuo-3.0.0.tar.gz",
    "platform": "Linux (x86, x86_64, ARMv6, ARMv7, ARMv8)",
    "description": "# Yasuo Package\n\n[![PyPI](https://img.shields.io/pypi/v/yasuo.svg)](https://pypi.org/project/yasuo/)\n[![Build Status](https://img.shields.io/badge/build-passed-brightgreen)](https://github.com/puffer-python/yasuo/actions)\n[![GitHub issues](https://img.shields.io/github/issues/puffer-python/yasuo)](https://github.com/puffer-python/yasuo/issues)\n\nYasuo Package is a Python package that provides functionality related to the popular game League of Legends.\nSpecifically, it provides tools for analyzing data related to the champion Yasuo.\n\n## Installation\n\nYou can install Yasuo Package using pip:\n\n```commandline\npip install yasuo\n```\n\n## Usage\n\nAfter installation, you can import Yasuo Package in your Python script as follows:\n\n```python\n\nimport yasuo\n\n```\n\n## List of Functions\n\n### Convert any to an integer\n\nThis code snippet provides a function convert_int_field() that can be used to convert any data type to an integer. If\nthe value cannot be converted, an exception is raised. This function takes in several parameters to customize the\nconversion process, such as a default value to return if conversion fails and a minimum value for the resulting integer.\n\nHere's an example usage of convert_int_field():\n\n```\n>> convert_int_field(10)\n10\n\n>> convert_int_field(\"10\")\n10\n\n>> convert_int_field(\"10a\", ignore_error=False, error_message=\"Input must be a valid integer.\")\nValueError: Input must be a valid integer.\n\n```\n\n### Vietnamese Text Converter\n\nThis package provides a function to convert Vietnamese text with diacritics to Vietnamese text without diacritics.\n\n```python\nfrom yasuo import convert\n\ntext_with_diacritics = \"\u0110\u00e2y l\u00e0 m\u1ed9t v\u00ed d\u1ee5 v\u1ec1 ti\u1ebfng Vi\u1ec7t c\u00f3 d\u1ea5u\"\ntext_without_diacritics = convert(text_with_diacritics)\nprint(text_without_diacritics)  # Output: \"Day la mot vi du ve tieng Viet co dau\"\n\n```\n\n### Normalized\n\nThe `normalized()` function converts a string to lowercase, removes all diacritics (accents) and extra spaces. This\nfunction can be used to normalize user input or database entries for comparison purposes.\n\n```python\ninput_string = \"Tr\u01b0\u1eddng \u0110\u1ea1i h\u1ecdc B\u00e1ch Khoa H\u00e0 N\u1ed9i\"\nnormalized_string = normalized(input_string)\nprint(normalized_string)  # Output: \"truong dai hoc bach khoa ha noi\"\n\n```\n\n### Keep Single Spaces\n\nThis function keeps only single spaces between words in a string and removes any leading/trailing spaces.\n\n- Inputs:\n    - `s_string`: A string\n- Outputs\n    - A new string with only single spaces between words and no leading/trailing spaces.\n\nExample\n\n```python\nkeep_single_spaces(\"  This   is   a   test  \")\n'This is a test'\n\n```\n\n### Chunks\n\nThe `create_chunks()` function takes in two parameters: `src` and `step`.\n\n`src` is the source string or list that needs to be divided into chunks.\n\n`step` is the maximum length of each chunk.\n\nThe function creates a list of chunks by iterating over the `src` string or list and appending slices of length step to\na new list res.\n\nThe resulting list res contains all the chunks of length `step` that make up the original `src` string or list.\n\nExample:\n\n```python\nsrc = 'abcdefghijklmnopqrstuvwxyz'\nstep = 5\nchunks = create_chunks(src, step)\nprint(chunks)\n```\n\nOutput:\n\n```python\n[\n    'abcde',\n    'fghij',\n    'klmno',\n    'pqrst',\n    'uvwxy',\n    'z'\n]\n```\n\n### Recursively converts byte strings in a dictionary to Unicode strings.\n\nThe function reformat_dict recursively decodes byte-encoded dictionary keys and values to utf-8 strings.\n\nParameters:\n\n- data: a dictionary that may contain byte-encoded keys or values\n\nReturn:\n\n- A new dictionary with all byte-encoded keys and values decoded to utf-8 strings\n\nExample\n\n```python\ndata = {'name': b'John', 'age': 30, 'contacts': {'email': b'john@gmail.com', 'phone': b'123456789'}}\nnew_data = reformat_dict(data)\nprint(new_data)\n```\n\nOutput\n\n```python\n{\n    'name': 'John',\n    'age': 30,\n    'contacts': {\n        'email': 'john@gmail.com',\n        'phone': '123456789'\n    }\n}\n\n\n\n```\n\n### List Duplicates\n\nThis function checks if a list has duplicate elements. It returns True if there are duplicates, otherwise False.\n\nHere is an example usage:\n\n```python\n>> list_has_duplicates([1, 2, 3, 4, 5])\nFalse\n\n>> list_has_duplicates([1, 2, 3, 3, 4, 5])\nTrue\n\n```\n\n### Remove duplicated\n\nThis function removes duplicates from a given list using a Python dictionary. It converts the list to a dictionary where\nthe elements of the list become the keys of the dictionary, then converts the dictionary back into a list. This process\neliminates any duplicate keys and returns a list with unique elements in the original order.\n\nExample:\n\n```python\na_list = [1, 2, 3, 1, 4, 2, 5, 6, 5]\nremove_duplicate_from_list(a_list)\n[1, 2, 3, 4, 5, 6]\n\n```\n\n### Is Json\n\nThe `is_json` function checks whether the input string is a valid JSON or not.\n\n`str_input`: a string to be checked. If the string is a valid JSON, the function returns True. Otherwise, it returns\nFalse.\n\nHere is an example usage:\n\n```python\ninput_str = '{\"name\": \"John\", \"age\": 30, \"city\": \"New York\"}'\nresult = is_json(input_str)\nprint(result)  # True\n\ninvalid_str = 'this is not a valid JSON'\nresult = is_json(invalid_str)\nprint(result)  # False\n```\n\n### Random String\n\nThis function generates a random string of a specified length, consisting of both letters (upper and lower case) and\ndigits.\n\n- `length`: An optional integer argument that specifies the length of the generated string. The default length is 6.-\n\nThe function uses the `string` and `random` modules to generate a string with a combination of upper and lower case\nletters and digits. It then uses a join function to `join` these characters together to form the random string.\n\nExample usage:\n\n```python\n\nrandom_string()  # Output: 'tDy8Vc'\nrandom_string(10)  # Output: 'JnZ8WbKu3P'\n\n```\n\n### Camel Case\n\nThe camel_case function takes an input string with underscore-separated words and converts it to camel case format.\n\nFor example, if the input string is `\"hello_world\"`, the output will be `\"helloWorld\"`.\n\nThe function takes one parameter:\n\n- `s_string`: the input string to be converted The function returns a string in camel case format. If the input string\n  is empty or not a string, the function returns None.\n\nExample\n\n```python\n>> camel_case('hello_world')\n'helloWorld'\n>> camel_case('hello_big_world')\n'helloBigWorld'\n>> camel_case('hello')\n'hello'\n>> camel_case('hElLo')\n'hello'\n\n```\n\n### Generate URL Key\n\nThe `generate_url_key` function takes an input string and returns a URL-safe version of the string, suitable for use as\na URL key.\n\nThe function first converts the input string to a normalized format, then removes any characters that are not letters,\nnumbers, or hyphens. The resulting string is then returned.\n\nThe function takes one parameter:\n\n- `a_string`: the input string to be converted The function returns a string in URL-safe format. If the input string is\n  empty or not a string, the function returns None.\n\nExample\n\n```python\ngenerate_url_key('Hello, world!')\n'hello-world'\ngenerate_url_key('Python is awesome')\n'python-is-awesome'\ngenerate_url_key('My favorite number is 42')\n'my-favorite-number-is-42'\ngenerate_url_key('')\nNone\n\n```\n\n### Flatten List\n\nThe `flatten_list` function takes a two-dimensional list as input and flattens it into a one-dimensional list.\n\nFor example, if the input list is `[[1, 2], [3, 4], [5, 6]]`, the output will be `[1, 2, 3, 4, 5, 6]`.\n\nThe function takes one parameter:\n\n- `a_list`: the input two-dimensional list to be flattened The function returns a one-dimensional list. If the input is\n  not a two-dimensional list, the function returns None.\n\nExample:\n\n```commandline\n>> flatten_list([[1, 2], [3, 4], [5, 6]])\n[1, 2, 3, 4, 5, 6]\n>> flatten_list([[1, 2, 3], [4], [5, 6]])\n[1, 2, 3, 4, 5, 6]\n>> flatten_list([[1, 2], [3, 4], 5, 6])\nNone\n\n```\n\n### Get UTC\n\nThe `get_utc_time` function retrieves the current UTC time given a local time zone name. It uses the pytz library to\nconvert the local time zone to UTC. The function takes two parameters:\n\n- `local_name`: a string representing the name of the local time zone.\n- `fmt` (optional): a string representing the format of the returned UTC time.\n\nIf not provided, the function returns a datetime object in the UTC time zone. If the local time zone name is not found,\nthe function raises a ValueError.\n\nExample:\n\n```commandline\n>> get_utc_time('US/Eastern', '%Y-%m-%d %H:%M:%S')\n'2022-03-07 02:30:26'\n>> get_utc_time('Europe/London')\ndatetime.datetime(2022, 3, 7, 7, 30, 26, 518046, tzinfo=<UTC>)\n\n```\n\n### Dict Diff\n\nThe `dict_diff` function takes in two dictionaries, `old_dict` and `new_dict`, and returns a list of differences between\nthem in the format of `{\"key1\":{\"old\":\"old_value_key1\", \"new\":\"new_value_key1\"}}`. If the value of a key is different\nbetween the two dictionaries, it will be included in the result list.\n\nHere's an example:\n\n```python\nold_dict = {'key1': 'value1', 'key2': 'value2', 'key3': 'value3'}\nnew_dict = {'key1': 'value1', 'key2': 'new_value2', 'key4': 'value4'}\ndiff_list = dict_diff(old_dict, new_dict)\nprint(diff_list)\n\n```\n\nOutput\n\n```commandline\n[{'key2': {'old': 'value2', 'new': 'new_value2'}}, {'key3': {'old': 'value3', 'new': None}}, {'key4': {'old': None, 'new': 'value4'}}]\n\n```\n\n### Decapitalize\n\nThe `decapitalize` function takes a string input and returns the string with the first character in lowercase and all\nother characters unchanged.\n\nFor example, if the input string is `\"Decapitalize string\"`, the output will be `\"decapitalize string\"`.\n\nThe function takes one parameter:\n\n- `a_string`: the input string to be decapitalized\n\nThe function returns a string with the first character in lowercase and all other characters unchanged. If the input\nstring is empty or not a string, the function returns None.\n\nExample:\n\n```python\n>> decapitalize(\"Decapitalize string\")\n'decapitalize string'\n>> decapitalize(\"capitalize\")\n'capitalize'\n>> decapitalize(\"\")\n''\n\n```\n\n### Safe Cast\n\nThe `safe_cast` function is used to convert a value of any type to a specified type. If the conversion fails, it returns\na default value instead of raising an exception.\n\nThe function takes three parameters:\n\n- `val`: the value to be converted\n- `to_type`: the type to which val should be converted\n- `default` (optional): the default value to be returned if the conversion fails. If default is not specified, None is\n  returned.\n\nThe function first tries to convert `val` to `to_type` using the built-in conversion function for that type. If the\nconversion fails, it tries to convert `val` to boolean if `to_type` is `bool`. If the conversion succeeds, it returns\nthe converted value; otherwise, it returns the default value.\n\nExample:\n\n```python\n>> safe_cast(\"10\", int, 0)\n10\n\n>> safe_cast(\"10.5\", float, 0.0)\n10.5\n\n>> safe_cast(\"True\", bool, False)\nTrue\n\n>> safe_cast(\"invalid\", int, 0)\n0\n\n>> safe_cast(None, int, 0)\n0\n\n>> safe_cast(None, int)\nNone\n\n```\n\n### Cast Separated String\n\nThe `cast_separated_string_to_ints` function takes a string containing integers separated by a specified separator and\nreturns a list of integers.\n\nThe function takes two parameters:\n\n- `separated_str`: a string containing integers separated by a specified separator\n- `sep`: the separator used in the input string (default value is ,)\n\nThe function returns a list of integers extracted from the input string, ignoring any non-numeric values. If the input\nstring is empty, the function returns an empty list.\n\nExample:\n\n```python\n>> cast_separated_string_to_ints('1,2,3,4')\n[1, 2, 3, 4]\n>> cast_separated_string_to_ints('1-2-3-4', '-')\n[1, 2, 3, 4]\n>> cast_separated_string_to_ints('1,abc,3,def')\n[1, 3]\n>> cast_separated_string_to_ints('')\n[]\n\n```\n\n### HTML Converter\n\nThe `convert_to_html_tag` function replaces all newline characters in the input string with an HTML line break\ntag (`<br>`), effectively converting the string to a format suitable for display in HTML.\n\nFunction parameters:\n\n- `s_string` : The input string to be converted.\n\nFunction return value:\n\n- The function returns a string with newline characters replaced by the HTML line break tag.\n\n### Fibonacci\n\nThis function calculates the value of the nth number in the Fibonacci sequence. The Fibonacci sequence is a series of\nnumbers in which each number is the sum of the two preceding numbers, starting from 0 and 1. For example, the first few\nnumbers in the sequence are 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ...\n\nThe number parameter is the position of the desired Fibonacci value (starting from 0). For instance, if number is 5, the\nfunction returns the 5th number in the Fibonacci sequence, which is 5. If number is less than or equal to 1, the\nfunction simply returns number.\n\nThe function uses recursion to calculate the Fibonacci value. Specifically, it calls itself with number - 1 and number -\n2 as arguments and returns the sum of the two resulting values.\n\nExample\n\n```python\n\n# Calculate the first 10 numbers in the Fibonacci sequence\nfor i in range(10):\n    print(fibonacci(i))\n# Output: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34\n\n```\n\n# License\n\nThis code is released under the MIT License.\n\nYou can copy and paste the code into your Python project and modify it as needed. If you have any questions or issues,\nplease don't hesitate to reach out.\n\n\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "A Yasuo Python package",
    "version": "3.0.0",
    "project_urls": {
        "Homepage": "https://github.com/puffer-python/yasuo"
    },
    "split_keywords": [
        "yasuo",
        "python",
        "vietnamese"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "12e4ec76bc6c1175f45ee3dedb00144534b505fc2b719a58731d3bf12a1c6b7d",
                "md5": "51366a89505ebc98dfee3618d9ae9796",
                "sha256": "a6a557cd908ab72306c81a61f1a20c3f5a0adc5f4dcc43bfc4d226cbff18107d"
            },
            "downloads": -1,
            "filename": "yasuo-3.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "51366a89505ebc98dfee3618d9ae9796",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 9032,
            "upload_time": "2023-05-11T09:26:41",
            "upload_time_iso_8601": "2023-05-11T09:26:41.965860Z",
            "url": "https://files.pythonhosted.org/packages/12/e4/ec76bc6c1175f45ee3dedb00144534b505fc2b719a58731d3bf12a1c6b7d/yasuo-3.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "beee024aca15afa111dc0c9ec3b91e2b2f9d796eb645cfa768c6ec9e467bb12c",
                "md5": "d145072df07a41646f9d20a9315a031d",
                "sha256": "9c55a78d18bcdc6e635614a055b346ca6f851ac339b72e9074d394e895371d1c"
            },
            "downloads": -1,
            "filename": "yasuo-3.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "d145072df07a41646f9d20a9315a031d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 10383,
            "upload_time": "2023-05-11T09:26:43",
            "upload_time_iso_8601": "2023-05-11T09:26:43.860417Z",
            "url": "https://files.pythonhosted.org/packages/be/ee/024aca15afa111dc0c9ec3b91e2b2f9d796eb645cfa768c6ec9e467bb12c/yasuo-3.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-11 09:26:43",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "puffer-python",
    "github_project": "yasuo",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "yasuo"
}
        
Elapsed time: 0.21765s