semvec/pypi-packages huggingface dataset:
pydanticext 0.0.1
A lib to define pydantic models extendable at runtime.
Requires Python: >=3.6

[![CI](https://github.com/lmignon/pydantic-ext/actions/workflows/ci.yml/badge.svg)](https://github.com/lmignon/pydantic-ext/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/lmignon/pydantic-ext/branch/master/graph/badge.svg?token=Z9FWM57T14)](https://codecov.io/gh/lmignon/pydantic-ext)

# pydantic-ext

This addons provides a new type used to declare [Pydantic](https://pypi.org/project/pydantic/)
model as [Extendable](https://pypi.org/project/extendable/) class.

```python
from pydantic import BaseModel
from pydanticext import ExtendableModelMeta
from extendable import context, registry

class Location(BaseModel, metaclass=ExtendableModelMeta):
    lat = 0.1
    lng = 10.1

class ExtendedLocation(Location, extends=Location):
    name: str

_registry = registry.ExtendableClassesRegistry()
context.extendable_registry.set(_registry)
_registry.init_registry()

loc = Location(**{"lat": 12.3, "lng": 13.2, "name": "My Loc"})

loc.dict() == {"lat": 12.3, "lng": 13.2, "name": "My Loc"}
#> True

loc.schema()
#> {'title': 'Location', 'type': 'object', 'properties': {'lat': {'title': 'Lat', 'default': 0.1, 'type': 'number'}, 'lng': {'title': 'Lng', 'default': 10.1, 'type': 'number'}, 'name': {'title': 'Name', 'type': 'string'}}, 'required': ['name']}
```
bondo 0.3
this is a test file

# gle_ip_info

glip is a module for retrieve ip address like local-ip, global-ip, external-ip as string.

## Installation

Run the following to install:

'''python
pip install gle_ip_info
'''

## Usage
'''
from gle_ip_info import IP

Ip = IP() # Initialize the IP class

os = Ip.Os # To get your os info.

dev = Ip.devices # Gives connected devices as list.

local_ip = Ip.get_local_ip() # TO get your local ipaddress.

global_ip = Ip.get_global_ip() # To get your global ipaddress.
 
external_ip = Ip.get_external_ip() # To get external(of connected device) ipaddress, returns the ip address of 1st device
'''
## How it works

It use's -->
'''
    --> os module,
    --> requests module,
    --> platform module,
    --> upnpclient module.

***Local_IP is collected from the cmd(in Windows) or Bash-Terminal(in Linux) using 'ipconfig'/ 
'hostname -I' command.So there is no need to get the hostname like socket module does and 
the accuracy of the output is 100% in Linux Os.

***Global_IP is collected by sending request to 'https://checkip.amazonaws.com' or 
'https://www.wikipedia.org' using python requests module.So to get the global_ip a stable 
net connection is needed.

***External_IP  of any router or alike devices can be collected using upnpclient module.
It takes a little more time to get the external_ipaddress Compare to other two functions.Though it don't require
stable Internet connection but requires a stable connection between the devices.
'''
## License

MIT License