Giter Site home page Giter Site logo

py-sc-client's People

Contributors

alexandrzagorskiy avatar falser20 avatar mikhailsadovsky avatar mksmorlov avatar nikitazotov avatar shtress avatar smousy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

py-sc-client's Issues

Add error handling in a ScConstruction class

Describe the bug
If index by alias is not exist, error can be raised.

To Reproduce
image

Expected behavior
return None value

Additional context
Add error handling in a ScConstruction class, or use get() method for taking value from dict.

Problem in correct client completion

Problem with correct client completion in case of deal with non-existed node

To Reproduce
To reproduce can be execute next code for any non-existed identifier:
keynodes = ScKeynodes()
node = keynodes["hello"]

Expected behavior
Raises exception InvalidValueError and completes

Screenshots
Снимок экрана 2022-12-06 в 21 42 52

Non-private constants in sc_client.constants.sc_types

Describe the bug
In sc_client.constants.sc_types there are integer constants that are not supposed to be imported. (e.g. SC_TYPE_NODE, SC_TYPE_LINK, etc.)

Proposal
Mark this constants as private to avoid common user from occasionally importing them.

Typing error in ScLinkContent

Typing error

Where: sc_client.models.py - ScLinkContent

Type of content_type in ScLinkContent is ScLinkContentType (not int), so why it's comparing by value in type_to_str()?

class ScLinkContentType(Enum):
    INT = 0
    FLOAT = 1
    STRING = 2
    BINARY = 3


@dataclass
class ScLinkContent:
    data: str | int
    content_type: ScLinkContentType
    addr: ScAddr = None

    def __post_init__(self):
        if len(str(self.data)) > LINK_CONTENT_MAX_SIZE:
            raise LinkContentOversizeError

    def type_to_str(self):
        if self.content_type == ScLinkContentType.BINARY.value:
            return common.BINARY
        if self.content_type == ScLinkContentType.INT.value:
            return common.INT
        if self.content_type == ScLinkContentType.FLOAT.value:
            return common.FLOAT
        return common.STRING

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.