Comments (1)
Sorry for the late answer.
So I see what you want to do here, but it will have somewhat awkward consequences:
- if you have more than one match when searching, the search method should return a list, an not a single
Taxonomy
so directly callingmachinetags_expanded
won't be possible anyway.
In [7]: taxonomies.get('circl')
Out[7]: <pytaxonomies.api.Taxonomy at 0x7f910d461c50>
- the search method already search in all the possible fields (namespace, predicate, and value), and returns a list of the tags (or the expanded tag if you pass
expanded=True
), so you don't need to callmachinetags_expanded()
In [5]: taxonomies.search('ci')
Out[5]:
['ais-marking:CISA_Proprietary="true"',
'ais-marking:CISA_Proprietary="false"',
'circl:incident-classification="spam"',
'circl:incident-classification="system-compromise"',
'circl:incident-classification="scan"',
'circl:incident-classification="denial-of-service"',
'circl:incident-classification="copyright-issue"',
'circl:incident-classification="phishing"',
'circl:incident-classification="malware"',
'circl:incident-classification="XSS"',
'circl:incident-classification="vulnerability"',
'circl:incident-classification="fastflux"',
'circl:incident-classification="sql-injection"',
'circl:incident-classification="information-leak"',
'circl:incident-classification="scam"',
'circl:incident-classification="cryptojacking"',
'circl:incident-classification="locker"',
'circl:incident-classification="screenlocker"',
'circl:incident-classification="wiper"',
'circl:topic="finance"',
'circl:topic="ict"',
'circl:topic="individual"',
'circl:topic="industry"',
'circl:topic="medical"',
'circl:topic="services"',
'circl:topic="undefined"',
'euci:TS-UE/EU-TS',
'euci:S-UE/EU-S',
'euci:C-UE/EU-C',
'euci:R-UE/EU-R',
'ms-caro-malware-full:malware-family="Cinmus"',
'ms-caro-malware-full:malware-family="Citeary"',
'ms-caro-malware-full:malware-family="Ciucio"',
'veris:asset:country="CI"',
'veris:victim:country="CI"',
'veris:actor:external:country="CI"',
'veris:actor:partner:country="CI"']
In [6]: taxonomies.search('ci', expanded=True)
Out[6]:
['ais-marking:CISA_Proprietary="true"',
'ais-marking:CISA_Proprietary="false"',
'circl:incident-classification="Spam"',
'circl:incident-classification="System compromise"',
'circl:incident-classification="Scan"',
'circl:incident-classification="Denial of Service"',
'circl:incident-classification="Copyright issue"',
'circl:incident-classification="Phishing"',
'circl:incident-classification="Malware"',
'circl:incident-classification="XSS"',
'circl:incident-classification="Vulnerability"',
'circl:incident-classification="Fastflux"',
'circl:incident-classification="SQL Injection"',
'circl:incident-classification="Information leak"',
'circl:incident-classification="Scam"',
'circl:incident-classification="Cryptojacking"',
'circl:incident-classification="Locker"',
'circl:incident-classification="Screenlocker"',
'circl:incident-classification="Wiper"',
'circl:topic="Finance"',
'circl:topic="ICT"',
'circl:topic="Individual"',
'circl:topic="Industry"',
'circl:topic="Medical"',
'circl:topic="Services"',
'circl:topic="Undefined"',
'euci:TS-UE/EU-TS',
'euci:S-UE/EU-S',
'euci:C-UE/EU-C',
'euci:R-UE/EU-R']
Does it answer your question?
from pytaxonomies.
Related Issues (5)
- Exporting the full PyTaxonomies data structure in D3 js partition (v3) hierarchy (v4) model
- UnicodeDecodeError on Windows(Locales where UTF-8 is not the default encoding)
- Publish on PyPI HOT 1
- UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 4: ordinal not in range(128) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytaxonomies.