Code Monkey home page Code Monkey logo

Comments (1)

Rafiot avatar Rafiot commented on June 11, 2024

Sorry for the late answer.

So I see what you want to do here, but it will have somewhat awkward consequences:

  1. if you have more than one match when searching, the search method should return a list, an not a single Taxonomy so directly calling machinetags_expanded won't be possible anyway.
In [7]: taxonomies.get('circl')
Out[7]: <pytaxonomies.api.Taxonomy at 0x7f910d461c50>
  1. 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 call machinetags_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)

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.