Research
Recent Trends in Malicious Packages Targeting Discord
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
case-insensitive-dictionary
Readme
Typed Python Case Insensitive Dictionary
Install and update using pip.
$ pip install -U case-insensitive-dictionary
Method | Description |
---|---|
clear() | Removes all elements from the dictionary. |
copy() | Returns a copy of the dictionary. |
get(key, default) | Returns the value (case-insensitively), of the item specified with the key. Falls back to the default value if the specified key does not exist. |
fromkeys(iterable, value) | Returns a dictionary with the specified keys and the specified value. |
keys() | Returns the dictionary's keys. |
values() | Returns the dictionary's values. |
items() | Returns the key-value pairs. |
pop(key) | Remove the specified item (case-insensitively). The value of the removed item is the return value. |
popitem() | Remove the last item that was inserted into the dictionary. For Python version <3.7, popitem() removes a random item. |
CaseInsensitiveDict:
>>> from typing import Union
>>> from case_insensitive_dict import CaseInsensitiveDict
>>> case_insensitive_dict = CaseInsensitiveDict[Union[str, int], str](data={"Aa": "b", 1: "c"})
>>> case_insensitive_dict["aa"]
'b'
>>> case_insensitive_dict[1]
'c'
which also supports json encoding/decoding:
>>> import json
>>> from case_insensitive_dict import CaseInsensitiveDict, CaseInsensitiveDictJSONEncoder, case_insensitive_dict_json_decoder
>>> case_insensitive_dict = CaseInsensitiveDict[str, str](data={"Aa": "b"})
>>> json_string = json.dumps(obj=case_insensitive_dict, cls=CaseInsensitiveDictJSONEncoder)
>>> json_string
'{"Aa": "b"}'
>>> case_insensitive_dict = json.loads(s=json_string, object_hook=case_insensitive_dict_json_decoder)
>>> case_insensitive_dict
CaseInsensitiveDict({'Aa': 'b'})
Contributions are welcome via pull requests.
$ git clone git@github.com:DeveloperRSquared/case-insensitive-dict.git
$ cd case-insensitive-dict
$ poetry install
$ poetry shell
Tools including black, mypy etc. will run automatically if you install pre-commit using the instructions below
$ pre-commit install
$ pre-commit run --all-files
$ poetry run pytest
FAQs
Typed Python Case Insensitive Dictionary
We found that case-insensitive-dictionary demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
Security News
Socket CEO Feross Aboukhadijeh joins a16z partners to discuss how modern, sophisticated supply chain attacks require AI-driven defenses and explore the challenges and solutions in leveraging AI for threat detection early in the development life cycle.
Security News
NIST's new AI Risk Management Framework aims to enhance the security and reliability of generative AI systems and address the unique challenges of malicious AI exploits.